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

Why c is faster than c++?

0 Answers  


Identify the operators that is not used with pointer a. && b. # c. * d. >>

2 Answers  


What is volatile variable in c?

0 Answers  


What is pointer to pointer in c with example?

0 Answers  


logic for generating all the combinations of the any number of given letters. ex::::::::: if a,b,c,d are given the o/p should be abcd,dcba,dbac,bcad,................ 4*3*2*1 combinations............

2 Answers   Infosys,






What will be the outcome of the following conditional statement if the value of variable s is 10?

0 Answers  


Is it possible to pass an entire structure to functions?

0 Answers  


plssssss help !!....using array.. turbo c.. create a program that will accept number of words to be consored. .a word must not exceed 10 characters long .the text to be entered will be no longer than 200 characters .there will be no 10 words example: enter number of words to be censor: 5 enter words to censor: windows office microsoft bill gates enter text to censor: bill gates founded microsoft and makes office and windows sample output: <consored> <censored> founded <censored> and makes <censored> and <censored>

1 Answers  


which one is better structure or union?(other than the space occupied )

2 Answers  


What is advantage of pointer in c?

0 Answers  


How can I find out how much free space is available on disk?

0 Answers  


Is that possible to add pointers to each other?

0 Answers  


Categories