void main(){
int i;
i=printf("how r u?\n");
i=printf("%d",i);
printf("%d",i);}
The above code gives the result as:
how r u?
91
My question:
How does stores 9 and 1??
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
From the man page: Upon successful return, these functions return the number of characters printed…. If an output error is encountered, a negative value is returned.
So you are getting
9andibecauseprintfwrote out9and1characters respectively.This is also relevant: Why does printf return a value?