Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

which of the following shows the correct hierarchy of arithmetic operations in C a) (), **, * or/,+ or - b) (),**,*,/,+,- c) (),**,/,*,+,- d) (),/ or *,- or +

0 Answers  


What is a structural principle?

0 Answers  


a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list

0 Answers  


why we shiuld use main keyword in C

5 Answers  


consider the following structure: struct num nam{ int no; char name[25]; }; struct num nam n1[]={{12,"Fred"},{15,"Martin"},{8,"Peter"},{11,Nicholas"}}; ..... ..... printf("%d%d",n1[2],no,(*(n1 + 2),no) + 1); What does the above statement print? a.8,9 b.9,9 c.8,8 d.8,unpredictable value

4 Answers   TCS,


write a c program to print "Welcome" without using semicolon in the whole program ??

15 Answers   Infosys, TCS,


what is diff b/w huge & far & near pointer??

1 Answers   HCL,


Why & is used in scanf in c?

0 Answers  


What is a substring in c?

0 Answers  


Why doesn't C have nested functions?

2 Answers  


What are register variables? What are the advantage of using register variables?

0 Answers   TISL,


what is a pointer

4 Answers   Bank Of America, TCS,


Categories