Geeks Talk

Prepare for your Next Interview




What does printf function returns?

This is a discussion on What does printf function returns? within the C and C++ forums, part of the Software Development category; I mean that it may return whether how many no of variables printed or how many bytes of variables to be printed....


Go Back   Geeks Talk > Software Development > C and C++

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 03-28-2008
Junior Member
 
Join Date: Mar 2008
Location: hyderabad
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
chaitanyawithu is on a distinguished road
What does printf function returns?

I mean that it may return whether how many no of variables printed or how many bytes of variables to be printed.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 04-10-2008
Junior Member
 
Join Date: Jul 2007
Location: delhi
Posts: 7
Thanks: 1
Thanked 0 Times in 0 Posts
sachinbca2006 is on a distinguished road
Re: What does printf function returns?

printf function is library function and and you can also include own library function in c language using header file.
printf function does not return any value not even void.
Reply With Quote
  #3 (permalink)  
Old 04-14-2008
Junior Member
 
Join Date: Mar 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
kailash1981 is on a distinguished road
Re: What does printf function returns?

printf function return the total number of characters (or can say bytes) to be printed on the screen.It doesn't return number of variables.
As a proof you can compile below progam and run it will return 9
#include<stdio.h>
void main()
{
int i=0,j=100,z;
z=printf("i=%d j=%d",i,j);
printf("%d",z);
}
Reply With Quote
  #4 (permalink)  
Old 05-02-2008
Junior Member
 
Join Date: May 2008
Location: Bangalore
Posts: 8
Thanks: 1
Thanked 3 Times in 2 Posts
nisheedhcalicut is on a distinguished road
Re: What does printf function returns?

Hello,

Printf() will return the number of arguments it prints
Reply With Quote
  #5 (permalink)  
Old 05-16-2008
Junior Member
 
Join Date: May 2008
Location: Chennai
Posts: 2
Thanks: 0
Thanked 1 Time in 1 Post
ambika_prasan is on a distinguished road
Re: What does printf function returns?

Hi
printf will return number of character passed to the fierst string......
Reply With Quote
  #6 (permalink)  
Old 05-19-2008
Junior Member
 
Join Date: May 2008
Location: Bengaluru
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
mohantyrk1 is on a distinguished road
Re: What does printf function returns?

print f ( ) returns the number of characters are passed within " " (double quoted).
Reply With Quote
  #7 (permalink)  
Old 05-20-2008
Junior Member
 
Join Date: May 2008
Location: Bangalore
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
ramakanth.gupta is on a distinguished road
Re: What does printf function returns?

I agree with Kailash, it returns the number of characters the function prints on the display device...
Reply With Quote
Reply

  Geeks Talk > Software Development > C and C++


Thread Tools
Display Modes


Similar Threads

Thread Thread Starter Forum Replies Last Post
I have 4 million row but mapping returns only 400000 rows palakpari Data Warehousing 1 07-03-2007 01:09 AM
printf used along with sleep sarith Unix/Linux 1 06-16-2007 04:49 PM
Query that returns all responsibilities of a function JobHelper Oracle 0 01-04-2007 08:46 AM
Printtextscreen and printf fred C and C++ 1 07-13-2006 09:52 PM
Heard about different forms of printf and scanf joel C and C++ 3 06-29-2006 01:26 PM


All times are GMT -4. The time now is 10:39 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 GeekInterview.com. All Rights Reserved