"printf" is the common output statement used in C programming...
and printf is also a function as you may know and it returns an integer value. But we may or may not collect the return value.
It returns the number of characters to be printed..
int n;
n=printf("Hello World!");
n has got a value 12
It returns 0 if it does not print anything
if(printf("")) // is a false condition
if(printf("HELLO")) // is a true condition
try this code..
main()
{
printf(5+"Good Morning");
}
The output is : Morning
And same is the case in scanf
and printf is also a function as you may know and it returns an integer value. But we may or may not collect the return value.
It returns the number of characters to be printed..
int n;
n=printf("Hello World!");
n has got a value 12
It returns 0 if it does not print anything
if(printf("")) // is a false condition
if(printf("HELLO")) // is a true condition
try this code..
main()
{
printf(5+"Good Morning");
}
The output is : Morning
And same is the case in scanf
No comments:
Post a Comment