answersLogoWhite

0

What is the use of printf and scanf function?

Updated: 8/19/2019
User Avatar

Wiki User

13y ago

Best Answer

Printf prints something to the standard output stream, and scanf inputs something from the standard input stream.

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the use of printf and scanf function?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Can you use scanf function within printf function?

Yes: double d; printf ("scanf's just returned %d\n", scanf ("%lf", &d));


What is the difference between the printf and scanf statements in C?

well major difference between scanf and printf is that scanf is an input statment and printf is an output stament scanf is used to take data in from the user and printf is used to display the result on the screen Regards


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.


What are the example of turbo c with using scan and print function?

#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); }


What is the use of scanf function in c?

Hiii,scanf() is an predefined function of C to getting runtime input from the user.Syntax:-scanf("sequence specifier",&variable_name);example:-#includevoid main(){int number;printf("\n Enter any number"); //message to userscanf("%d",&number); //getting input from userprintf("\n entered number is %d",number); // displaygetch();}


What is the full form of printf or scanf?

int printf (const char *fmt, ...)orint scanf (const char *fmt, ...)


What is standard library function in c?

The Standard Librarary Function in C is printf,scanf inf Standard input output header.. which is stdio.h.


Is printf and scanf overloaded?

No, they are variadic.


How do you return to a main function?

..use do{} while{}..for example..#includemain(){int choose;double a,b,c;printf("Enter 7 if you want to use the calculator. Otherwise,type any character.\n");scanf("%d",&choose);do{if (choose==7){printf("Press 1 for addition.\n");printf("Press 2 for subtraction.\n");printf("Press 3 for multiplication.\n");printf("Press 4 for division.\n");scanf("%d",&choose);if (choose==1){printf("Enter the addends\n");scanf("%lf %lf", &a,&b);c=a+b,printf("The sum of %lf and %lf is %lf.\n",a,b,c);}else if(choose==2){printf("Enter the minuend and subtrahend\n");scanf("%lf %lf", &a,&b);c=a-b,printf("The difference of %lf and %lf is %lf.\n",a,b,c);}else if(choose==3){printf("Enter the multipliers\n");scanf("%lf %lf", &a,&b);c=a*b,printf("The product of %lf and %lf is %lf.\n",a,b,c);}else if(choose==4){printf("Enter the dividend and divisor\n");scanf("%lf %lf", &a,&b);c=a/b,printf("The quotient of %lf and %lf is %lf.\n",a,b,c);}else{printf("You have entered an invalid digit.\n");}printf("If you want to continue,press 7 and choose again from 1 to 4.\n");printf("Do you want to exit? Enter any key.\n");scanf("%d",&choose);}}while(choose==7);}


How do you make a program in C using do-while loop?

do statement; while (condition);ordo { statements } while (condition);


What does printf and scanf return?

Printf returned no. of character receive . scanf return no of variable to be inputed according to format specifier . eg: i=printf("thisisc") printf("%d",i); //i=7 j=scanf("dd",&a,&b,&c,&d); printf("%d",j); IT IS MOST APPROPRIATE ANSWER FOR THIS Q .......... PLZ DO Practically............


Why not use the ampression symbol in scanf statement in function?

scanf is a function, not a statement. Example: int a; char name[12]; scanf ("%d %s", &a, &name[0]);