Professional Documents
Culture Documents
Lecture10!10!11266 - Formatted and Unformatted Input Output Functions
Lecture10!10!11266 - Formatted and Unformatted Input Output Functions
Input/Output functions
Outline
• Formatted Input/Output functions
– printf() function
– scanf() function
• Conversion Specifiers
890
890
890
-890
32000
200000000
890
}
A
This is string
This is string
Example:
char c;
c = getchar();
©LPU CSE101 C Programming
#include<stdio.h>
main()
{
char c;
printf(“enter a character”);
c=getchar();
printf(“c = %c ”,c);
}
Enter a character k
c = k
enter a character: r
r
getche();
Syntax
char str[length of string in number];
gets(str);
Syntax
char str[length of string in number];
gets(str);
puts(str);