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
give me some knowledge about automation on which asked on interview
What is the mistake in the following program segment ? f() { int a; void c; f2(&c,&a);}
THESE POSTS ARE FOR THE DURATION OF FIVE YEARS. AFTER COMPLETION OF FIVE YEARS, THE PERSONNEL POSTED AGAINST THESE POSTS ARE LIKELY TO BE CONTINUED IN NIC. CAN Any body say that what it will be happened after 5 years? does they through us out from NIC? Is it a temporary job of 5 years is the probation period?
What is the most important thing to know about marine engineering?
sir/medam i had completed my B-TECH(CSE)2011 with 61%.i have to go USA for futhure studies.i dnt know what is steps for do futhure studies in USA so could you please tell me
i m doing engg in IT .for getting job which courses i have to do?
Which one is more efficient in terms of required memory space call-by-value or call-by-referance?
What is the procedure for taking leave while detecting Epf and Esi?
Please send the details and fee for Intools training course..I would like to do the course in second week of jUNE 2010.
what are the reseach done by itc brfore launching e-copal
What do you mean by client /server for a post scarcity world
while installing jad file to mobile its giving processing attribute MDlet-jar-URL error...how to fix it
Q1. A. Compare the advantages and disadvantages of a three- dimensional monitor using a varifocal mirror with a stereoscopic system. B. Write a routine to implement the polymarker function.
Index of an Array containing 'n' aliment varies from________to_______
Explain momentum?