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

give me some knowledge about automation on which asked on interview

1871


What is the mistake in the following program segment ? f() { int a; void c; f2(&c,&a);}

3882


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?

2248


What is the most important thing to know about marine engineering?

2089


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

2031


i m doing engg in IT .for getting job which courses i have to do?

2014


Which one is more efficient in terms of required memory space call-by-value or call-by-referance?

1908


What is the procedure for taking leave while detecting Epf and Esi?

2217


Please send the details and fee for Intools training course..I would like to do the course in second week of jUNE 2010.

2195


what are the reseach done by itc brfore launching e-copal

1877


What do you mean by client /server for a post scarcity world

2687


while installing jad file to mobile its giving processing attribute MDlet-jar-URL error...how to fix it

2134


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.

2220


Index of an Array containing 'n' aliment varies from________to_______

2045


Explain momentum?

1058