what is the output for the code :
main()
{
int i,j;
printf("%d %d ",scanf("%d%d",&i,&j));
}

Answer Posted / carol

scanf will return the number of arguments that are scanned
successfully from keyboard.So first it will get two values
from the user and return two . So the printf statement
prints 2 for the first %d and since there is no specific
value for second %d it will print garbage value.

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is table lookup in c?

833


about c language

1794


how do you write a function that takes a variable number of arguments? What is the prototype of printf () function?

1681


How can I remove the leading spaces from a string?

832


Explain how do you generate random numbers in c?

810


What is wrong with this program statement? void = 10;

1018


How many levels of indirection in pointers can you have in a single declaration?

820


What do you mean by c what are the main characteristics of c language?

788


What is this infamous null pointer, anyway?

783


i have to apply for the rbi for the post of officers. i need to know abt the entrance questions whether it may be aps or techinical....

1723


Why do we need arrays in c?

815


What is the best way of making my program efficient?

759


a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above

1129


Draw a diagram showing how the operating system relates to users, application programs, and the computer hardware ?

2343


What is gets() function?

854