Printf function is used in c language. Printf is used to print something to the standard output. ex: printf ('welcome');
it's not a statement, it's a function: len= printf (format, ...more-parameters...);
in stdio.h:extern int printf (const char *fmt, ...);
== == What is printf in c or prototype of printf with example (q) What is prototype of printf function ? Explain each term. Ans: Prototype of printf function is : int printf( const char *format ,…) Explanation of each term : Parameter of printf function is : (three continuous dots) : It is called ellipsis. It indicates the variable number of arguments. Example of ellipsis: #include void ellipsis(int a,...); void main() { int a=5,b=10; clrscr(); ellipsis(a,b); getch(); } void ellipsis(int a,...) { printf("%d ",a); } Output:5 So printf function can have any number of variables as an argument.
The printf() function prints a formatted string.
No, it is a function. But printf does return a value: the number of characters it has written.
It is a function.
int main() { // Call the printf function printf("This is a function call!\n"); return 0; }
Yes: double d; printf ("scanf's just returned %d\n", scanf ("%lf", &d));
The printf function calls on fprintf to write the result of sprintf to standard output. That is:printf("%i\n", 42);is exactly equivalent to:fprintf(stdout, "%i\n", 42);
Printf prints something to the standard output stream, and scanf inputs something from the standard input stream.
for(i=1;i<=5;i++) { for(x=5;x>=i;x--) { printf(" "); } for(j=1;j<=2*i-1;j++) { printf("1"); } printf("\n"); }
#include<stdio.h> Void main() { int a,b; printf("Enter a Number: "); // for print function as an out-put scanf("%d",&a); //for scan function as in input /* Here we can use print function once again as: */ a=a++; printf("%d",a); }