The C language provides a set of library functions to perform input and output (I/O) operations. Those functions can read or write any type of data to files.
Here printf(),scanf() functions are included in #include<stdio.h>
Printf() ----> to print the Information.
Scanf() ----> to read the Values.
Printf() ----> to print the Information.
Scanf() ----> to read the Values.
Here clrscr(), getch() functions are included in #include<conio.h>
Clrscr(); ----> to clear the previous output’s
Getch(); ----> to get the information or values
Computer displaying result is called output.
If we want to display the information on standard Output device we can use printf().
Printf( ):-
It is standard Output function which is used to display the information given by the user.
Syntax:
They are 3 types of syntax's.
Syntax 1:
printf(" information");To print information.
Ex:-
printf("Computersadda");
Sample Program:-
#include<stdio.h> #include<conio.h> void main() { clrscr(); printf("welcome to C-language"); getch(); } |
Output:-
welcome to C-language |
Sample Program 2:-
#include<stdio.h> #include<conio.h> void main( ) { clrscr( ); printf("One"); printf("Two"); printf("Three"); getch( ); } |
Output:-
OneTwoThree |
Syntax 2 :
To print 1 value.
Ex:-
printf("%d", a);
printf(" control strings ",variablename1,--- variablename n);
To print more than 1 value.
Syntax 3:
To print more than 1 value.
Ex:-
printf("%d%d",a,b);
__________________________________________________________________________________
__________________________________________________________________________________
Post a Comment