CSE101Formated and Unformated Input Output Function
CSE101Formated and Unformated Input Output Function
Input/Output functions
By:
Pundreekaksha Sharma
Assistant Professor
CSE Deptt.
©LPU CSE101 C Programming
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) 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);