Syntax: printf(" [ message ] [conversion specifier] [escape sequences]",[variable list>/[expression>);
Ex: printf("welcome to www.a2zhacks.blogspot.com ");
the above statement will display a message Welcome to www.a2zhacks.blogspot.com on the screen
Example: #include
main()
{
int x=67;
printf(" The value of x = %d",i);
}
the output of the above code is The Value of x = 67.
scanf() this is a standard input function of C. This function is used to accept any value or store in the given address of the specified variable according to the conversion specifier.
syntax: scanf("[conversion specifier list]",[&var1,&var2,&var3.....]);
example:
#include
main()
{
int x;
printf("Enter a number");
scanf("%d",&x);
printf("The number you entered is %d ",x);
getch()
}
the output will be that you will be asked a number and then the number will be stored in x and you will get a message that the number you entered is 123.
2 comments:
visit http://www.a2zhacks.blogspot form more great money making tip and sites.
good work..!!!
Latest Software PC | avs activation code
Post a Comment