CSE101Lec 9
CSE101Lec 9
Introduction
• Presentation of output is very important.
• Formatted functions scanf and printf :
– these functions input data from standard input
stream and
– output data to standard output stream.
• Include the header #include<stdio.h>
A) *56543,*56543*
B) * 6543,*6543 *
C) *6543 ,* 6543*
D) *6543,*6543*
A) 654,654
B) 654.123456,654.123456
C) 654.123,654.12
D) 654.000,654.00
Example:
char c;
c = getchar();
©LPU CSE101 C Programming
#include<stdio.h>
void main()
{
char c;
printf(“enter a character”);
c=getchar();
printf(“c = %c ”,c);
}
Enter a character k
c = k
enter a character: r
r
A) A
B) B
C) S
D) Compiler error
getche();
Syntax
char str[length of string in number];
gets(str);
puts(str);