What will be the output of the following program :
void main()
{
int a,b,c;
scanf("%1d %2d %3d",&a,&b,&c);
printf("Sum=%d",a+b+c);
}
[NOTE : THE USER INPUT IS :123456 44 544]
(a)Sum=480 (b)Sum=594 (c)Sum=589 (d)None of these

Answer Posted / ravinder

The answer is 480
Here it takes the first number as string
for %1d it takes first number 1 from 123456
for %2d it takes next two numbers 23 from 123456
for %3d it takes the remaining 456 from 123456
so sum is 1
23
456
----
480

Is This Answer Correct ?    13 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why did they used to make the mill chimneys so tall?

752


need tcs questn papers from 2007 to 2009 plzzzmail to 9015.rama@gmail.com its urgent

1508


what is the formula/ ratio for hollow block? considering to a 40 kgs of portland cement.

1386


write a programe to print this string in reverse order and find out how many times letter c is repeated? string = { c was desined by dennis ritchie}. also find out the lenth of the string.

1445


in single linked list , each node contains data and address of next node. if middle of list the node is damaged/crashed then how to find where the link is failed and how to get the all the data which is stored after the crashed node?

1305






I need to know the process to add 100 tapes in ATL. Ho to inicialize them to the system? How is all the process i need to follow> Thanks

1731


explain overloaded constrator © constractor

1656


. Give the C language equivalents of the following a)Function returning an int pointer b)Function pointer returning an int pointer c)Function pointer returning an array of integers d)Array of function pointer returning an array of integers

1588


What is the significance of superconductors?

591


What is Lease Line?Why power cord is not required to NT Boxex on which lease is connected ?Why we use use NT BOXEs for ISDN and Lease line?

1460


sir, please send me the last three years exam papers conducted by CPCL- RECRUITMENT EXAM FOR Recruitment of Engineer ELECTRICAL ENGINEERING. A Soon as possible. i would be greatfull to u

1340


i want to know how can i divide the bandwidth among two computers.say i have a connection of 256 kbps dsl connection. i have a switch.now i want to divide this 256 kbps in two 128,128 equal connections.so that both of us can work on our separate 128 speed

1532


how u test the idoc in inbound and outbound?

1572


i have passed my gRaduation in BCA and now im looking for post graduation from Germany, i haver passed my ielts wth 6 band, nw plz tell me some question that wll ambessay ask

1379


Derive the equation that links voltage, charge and capacitance.

710