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

Answers were Sorted based on User's Feedback



What will be the output of the following program : void main() { int a,b,c; ..

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

What will be the output of the following program : void main() { int a,b,c; ..

Answer / sanchit

none of these

Is This Answer Correct ?    1 Yes 5 No

Post New Answer

More Engineering AllOther Interview Questions

hi i am an CSE engg student and i cleared the PE exam of BEL 2012 both 24/07/012 and 01/08/2012 , so please if someone can help me with PE Interview question or subject or topics which i should cover that help me clear both Interview.PLZ help. my mail id is rjjkumar99@gmail.com

0 Answers   BEL,


how to increase the chiller effiency?

0 Answers  


Write a program using string fuctions that accepts a price of an item and display its coded value. The base of the key is: X c o m p u t e r s 0 1 2 3 4 5 6 7 8 9

0 Answers  


List three things you can do with the files you create by recording your voice on your computer

0 Answers  


in header files whether functions are declared or defined in c language?

2 Answers  


plz explain abt refrigeration r22 bitzer comprassors trouble shooting and maintenance

0 Answers  


what is a pointer in c language?

0 Answers  


What type of questions are asked in interview?

0 Answers  


hey frnds..i have taken an emergency interview date of 21st july and my school is starting from 8th sept...i was continuously checking the date from 10 days but was not able to get a normal date...so can i get a rejection on this, that i have taken an emergency date.??????

0 Answers  


who is your favourate actor in tollywood tellme about him in few points

0 Answers   Genpact,


why dijkstra algorithm not used for negative weighted edges graph??

0 Answers  


can you provide me uniken pvt ltd. technical interview question and answer?

0 Answers  


Categories
  • Civil Engineering Interview Questions Civil Engineering (5085)
  • Mechanical Engineering Interview Questions Mechanical Engineering (4452)
  • Electrical Engineering Interview Questions Electrical Engineering (16637)
  • Electronics Communications Interview Questions Electronics Communications (3918)
  • Chemical Engineering Interview Questions Chemical Engineering (1095)
  • Aeronautical Engineering Interview Questions Aeronautical Engineering (239)
  • Bio Engineering Interview Questions Bio Engineering (96)
  • Metallurgy Interview Questions Metallurgy (361)
  • Industrial Engineering Interview Questions Industrial Engineering (259)
  • Instrumentation Interview Questions Instrumentation (3014)
  • Automobile Engineering Interview Questions Automobile Engineering (332)
  • Mechatronics Engineering Interview Questions Mechatronics Engineering (97)
  • Marine Engineering Interview Questions Marine Engineering (124)
  • Power Plant Engineering Interview Questions Power Plant Engineering (172)
  • Textile Engineering Interview Questions Textile Engineering (575)
  • Production Engineering Interview Questions Production Engineering (25)
  • Satellite Systems Engineering Interview Questions Satellite Systems Engineering (106)
  • Engineering AllOther Interview Questions Engineering AllOther (1379)