Printf Statement:-
"Printf" is statement is used to print something on the output screen in C language program. now this is a simple example of "printf"statement.
Program:-
#include<stdio.h>
#include<conio.h>
void main(void)
{
clrscr();
printf("My name is ammar");
printf("\n I live in wah cantt");
printf("\n I am student");
getch();
}
Output:-
My name is ammar
I live in wah cantt
I am student
Note:-
As you can see that this program is exactly same like the previous program the only addition is "\n " which is used to go to the next line you can use it anywhere in the "printf" statement to go to the new line.
No comments:
Post a Comment