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

Answers were Sorted based on User's Feedback



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

Answer / tasneemuddin

The result of this program will be:
you have to enter two int numbers
output : 2 <the last number entered>

Is This Answer Correct ?    12 Yes 6 No

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

Answer / nani

The result of this program will be:
you have to enter two int numbers
output : 2 <the last number entered>

Is This Answer Correct ?    1 Yes 0 No

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

Answer / sha

The first output would be the number of values scanned by
scanf, i.e. 2. I compiled the code and the second output
seems to be the address the second input given by user.

Input: 4 5
Output: 2 1242772

Is This Answer Correct ?    1 Yes 1 No

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

Answer / 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

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

Answer / varun

The Console will wait for two integer inputs.
After giving any two integer values, it will
return two values
1) no. of input i.e 2
2) Address of the first integer.
e.g
I have tested it with input-> 1,1 ; 2,9; 3,5; etc.....
For all it returns 2 3457158

Is This Answer Correct ?    0 Yes 0 No

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

Answer / suraj verma

It will return number of arguments taken
by scanf function which is two in this case
& the other value can be any garbage value.

Is This Answer Correct ?    0 Yes 1 No

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

Answer / vaibhav

the output will be
2(no. of inputs) <last number entered>

Is This Answer Correct ?    2 Yes 4 No

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

Answer / aarti dhiman

When we compile this program then 1 warning shows that the
function should return the value

Is This Answer Correct ?    0 Yes 2 No

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

Answer / sundar

for give input is 1 2
an output is 22

Is This Answer Correct ?    1 Yes 4 No

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

Answer / prashant sharma

first the computer will take the two values as inputs &
then will show junk value

Is This Answer Correct ?    1 Yes 4 No

Post New Answer

More C Interview Questions

What is main () in c?

0 Answers  


What is the difference between array and pointer?

0 Answers  


WRITE A PROGRAM TO MERGE TWO SORTED ARRAY USING MERGE SORT TECHNIQUE..

0 Answers  


Why is not a pointer null after calling free?

0 Answers  


which one of follwoing will read a character from keyboard and store in c a)c=getc() b)c=getchar() c)c=getchar(stdin) d)getc(&c) e)none

7 Answers   Trident,


What is pass by reference in functions?

0 Answers  


Is javascript based on c?

0 Answers  


What is alloca() and why is its use discouraged?

1 Answers  


how to set Nth bit of variable by using MACRO

3 Answers   HCL,


When do you say that a digraph is acyclic A)if and only if its first search does not have back arcs B)a digraph is acyclic if and only if its first search does not have back vertices C)if and only if its first search does not have same dfnumber D)None of these

1 Answers   Accenture, IBM,


write a c program to find the largest and 2nd largest numbers from the given n numbers without using arrays

0 Answers   IBM,


Find the O/p of the following struct node { char *name; int num; }; int main() { struct node s1={"Harry",1331}; struct node s2=s1; if(s1==s2) printf("Same"); else printf("Diff"); }

1 Answers  


Categories