CoolInterview.com - World's Largest Collection of Interview Questions
Send Free SMS
 Interview Questions  
 Our Services  


INTERVIEW QUESTIONS LANGUAGES C DETAILS
Question :
What are returned by printf(), scanf() functions,if they return anything means what are that?


Category C Interview Questions
Rating (5.0) By 3 users
Added on 8/18/2006
Views 3534
Rate it!
Answers:

Return type of printf() and scanf() is integer. scanf() returns the no.of variables used and printf() returns the total no.of bytes.



return type of scanf and printf is int

scanf returns no of valid inputs you are getting inside it
printf returns no of characters as well as formatspecifier inside it



 Posted by: balu    

Contact balu  Contact balu

both the printf and scanf functions return some value.this can be checked readily by assigning them to a variable.it returns value depending on the variable to which it is assigned



 Posted by: sreekanth reddy    

Contact sreekanth reddy  Contact sreekanth reddy

printf and scanf are library functios used in "c language".
printf is used to print the o/p on the monitor or display the o/p.
scanf is used to read the input values into adrress of that variable from the user.
printf and scanf returns the values depend on "datatype".



 Posted by: sreelatha    

Contact sreelatha  Contact sreelatha

sanf and printf are both library functions printf gives the output so it gives and calculate the total number of bytes which must be a integer value.
sanf calculates the total number of valid inputs so it must be a int.



 Posted by: pritam chakraborty    

Contact pritam chakraborty  Contact pritam chakraborty

printf and scanf are library functios used in "c language".
printf is used to print the o/p on the monitor or display the o/p.
scanf is used to read the input values into adrress of that variable from the user.
printf and scanf returns the values depend on "datatype".



 Posted by: veena    

Contact veena  Contact veena

scanf() return the no. of arguments reads sucessfully.

ex-
scanf("%d",&x); is 1
and printf() returns the no. of character to be printed.



 Posted by: bharat biswal,bhubaneswar    

Contact bharat biswal,bhubaneswar  Contact bharat biswal,bhubaneswar

printf is used to display the values of variables on screen according to its format specifier.
scanf is used to read the values that are provided by user through keyboard and store these values in variables.
printf return the value that it successfully print on screen.
similarly scanf return that value that it read successfully.



 Posted by: dheeraj sharma    

Contact dheeraj sharma  Contact dheeraj sharma

Both "printf()" and "sacnf()" returns the integer values.It returns no of values used;e.g
main()
{
int i=printf("hello");
printf("String Lengeth = %d",i);
}



 Posted by: Narendra Kangralkar    

Contact Narendra Kangralkar  Contact Narendra Kangralkar

what is the output of
main()
{
int i;
i=printf("hello");
printf(i);
}



 Posted by: sai    

Contact sai  Contact sai


If you have the better answer, then send it to us. We will display your answer after the approval.
Name :*
Email Id :*
Answer :*
Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
Process Verification  Enter the above shown code:*
Inform me about updated answers to this question

   
Related Questions
View Answer
Difference between arrays and pointers?

View Answer
What is the purpose of main( ) function?

View Answer
why n++ executes faster than n+1?


View Answer
What is the difference between a string and an array?


View Answer
Is it better to use a pointer to navigate an array of values,or is it better to use a subscripted array name?


View Answer
Can the sizeof operator be used to tell the size of an array passed to a function?


View Answer
Is using exit() the same as using return?


View Answer
Is it possible to execute code even after the program exits the main() function?


View Answer
What is a static function?


View Answer
How do you print an address?


View Answer

Please Note: We keep on updating better answers to this site. Subscribe to our newsletter to get notified when better answer is posted.

Notify me when better answer is posted!
Email:

View ALL C Interview Questions

User Options
Sponsored Links


Copyright ©2003-2010 CoolInterview.com, All Rights Reserved.
Privacy Policy | Terms and Conditions
Page URL: http://www.coolinterview.com/interview/10834/default.asp?cachecommand=bypass


Download Yahoo Messenger | Placement Papers| FREE SMS | ASP .Net Tutorial | Web Hosting | Free SMS | Dedicated Servers | Joke of the Day

0.7