Results 1 to 4 of 4

Thread: Return Value of Functions

  1. #1
    Contributing Member
    Join Date
    May 2006
    Answers
    64

    Return Value of Functions

    All functions return some value. Does it mean that even printf and scanf which are functions in C return some value? If so what is the value returned by these functions.


  2. #2
    Contributing Member
    Join Date
    May 2006
    Answers
    82

    Re: Return Value of Functions

    Yes. As all functions return value so are these functions. I am not aware about scanf but printf returns the number of characters printed by the printf function. Hope we get to know about the return value of more functions in this discussion.


  3. #3
    Junior Member
    Join Date
    Aug 2007
    Answers
    15

    Re: Return Value of Functions

    printf returns the number of characters that it prints, whereas scanf returns the number of format specifiers being passed to it in the format string.

    Correct me if i am wrong...


  4. #4
    Junior Member
    Join Date
    Sep 2007
    Answers
    2

    Re: Return Value of Functions

    Quote Originally Posted by janelyn View Post
    All functions return some value. Does it mean that even printf and scanf which are functions in C return some value? If so what is the value returned by these functions.
    ya printf and scanf also return values.
    print return no of character printed successfully or negetive value if an error occured.
    scanf return no of argument that are inputed or read .


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact