answersLogoWhite

0

How many arguments does printf takes?

Updated: 12/10/2022
User Avatar

Wiki User

11y ago

Best Answer

any number of parameters. No limit!

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How many arguments does printf takes?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

How many arguments pass in function?

zero or more it can be fixed or variable (printf is an example)


Creating a program using switch statement and if and else statement?

Not that difficult... int main (int argc, char **argv) { if (argc==1) printf ("No arguments\n"); else printf ("%d arguments\n", argc-1); goto END; END: return 0; }


Wap for swapping values of two variables using pointers as arguments to functions?

# include<stdio.h> # include<conio.h> void main() { clrscr(); int a,b; printf ("Enter the first value:"); scanf ("%d",& a ); printf ("Enter the second value:"); scanf ("%d",& b ); printf ("\n\nBefor swaping the values "); printf ("\nThe first value is %d",a); printf ("\nThe second value is %d",b); printf ("\n\nAfter swaping the values "); printf ("\nThe first value is %d",b); printf ("\nThe second value is %d",a); }


Is printf keyword?

== == 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.


C programming diamond shape for loops Problem and output sample is in the picture?

#include<stdio.h> main() { int i; for(i=1;i<=1;i++) { printf("*",i); } printf("\n"); for(i=1;i<=3;i++) { printf("*",i); } printf("\n"); for(i=1;i<=5;i++) { printf("*",i); } printf("\n"); for(i=1;i<=3;i++) { printf("*",i); } printf("\n"); for(i=1;i<=1;i++) { printf("*",i); } }

Related questions

How many arguments pass in function?

zero or more it can be fixed or variable (printf is an example)


Creating a program using switch statement and if and else statement?

Not that difficult... int main (int argc, char **argv) { if (argc==1) printf ("No arguments\n"); else printf ("%d arguments\n", argc-1); goto END; END: return 0; }


What is the difference between echo and printf command of UNIX?

Echo merely repeats its command line arguments as stated. The 'printf' command allows for formatted print and a more exacting method of printing out information. Printf requires you to specify the format of what you want to print; echo does not have this ability.


Wap for swapping values of two variables using pointers as arguments to functions?

# include<stdio.h> # include<conio.h> void main() { clrscr(); int a,b; printf ("Enter the first value:"); scanf ("%d",& a ); printf ("Enter the second value:"); scanf ("%d",& b ); printf ("\n\nBefor swaping the values "); printf ("\nThe first value is %d",a); printf ("\nThe second value is %d",b); printf ("\n\nAfter swaping the values "); printf ("\nThe first value is %d",b); printf ("\nThe second value is %d",a); }


Can you use nested printf?

printf ("nested printf returned %d\n", printf ("inner printf\n"));


How do you get your boyfriend back if you have finished over too many arguments?

Too many arguments now = Too many arguments later


Is printf keyword?

== == 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.


C programming diamond shape for loops Problem and output sample is in the picture?

#include<stdio.h> main() { int i; for(i=1;i<=1;i++) { printf("*",i); } printf("\n"); for(i=1;i<=3;i++) { printf("*",i); } printf("\n"); for(i=1;i<=5;i++) { printf("*",i); } printf("\n"); for(i=1;i<=3;i++) { printf("*",i); } printf("\n"); for(i=1;i<=1;i++) { printf("*",i); } }


What is an arity?

An arity is a number of arguments or operands a function or operation takes.


What Is Arity?

An arity is a number of arguments or operands a function or operation takes.


What is an adicity?

An adicity is the number of arguments or operands a function or operation takes.


Can you write a function similar to scanf?

//program for myprintf using variable arguments #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <stdarg.h> int compare(const void * var1,const void * var2) { if(*(int *)var1 > *(int *)var2) { return(0); } else{ return(1); } } int myPrintf(const char * output ,...) { va_list arguments; int stringlength,stringIndx; char *s; int d; char c; stringlength = strlen(output); va_start(arguments,output); for(stringIndx = 0;stringIndx < stringlength;stringIndx++) { if(output[stringIndx] == '%') { stringIndx++; switch(output[stringIndx]) { case 's': /* string */ s = va_arg(arguments, char *); printf("%s\n", s); break; case 'd': /* int */ d = va_arg(arguments, int); printf("%d\n", d); break; case 'c': /* char */ default: /* need a cast here since va_arg only takes fully promoted types */ c = (char) va_arg(arguments, char); printf("%c\n", c); break; } } else{ printf("%c",output[stringIndx]); } } } void main() { unsigned int au32Nos[10] = {32,44.,55,66,11,8,9,7,9,10}; qsort(au32Nos,10,4,compare); myPrintf(" %d %d %d %d %d %d %d %d %d %d",au32Nos[0],au32Nos[1],au32Nos[2],au32Nos[3],au32Nos[4],au32Nos[5],au32Nos[6],au32Nos[7],au32Nos[8],au32Nos[9]); }