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

how can one get scholership based on gre score ang how much scholarship one can get, plz suggest the way one can apply and get scholarship

0 Answers  


Hi my dears I have 2 questions. 1- how many types of test are there at all? 2- how can I define test characteristics (such as test duration and parameter severity)in developing a modern technological equipment? I tanks you for introducing or sending a text handbook or guidebook file for me. thanks for your coming answers. yours sincerely

0 Answers  


why we need embedded system

0 Answers  


what is c dot

0 Answers  


what is the PID controller?

0 Answers   Cadila,






how to calculate when (-) sign givcn in the power number for example 125^-5

1 Answers  


AD backups and restoration

0 Answers   Wipro,


Explain momentum?

0 Answers  


Hi friends..cud any help to get QC 9.2 trial..i tried with HP site but did'nt got it..please help me out

0 Answers  


Why it is a preferable option in parallelextender development ?

0 Answers  


Hi dost here Alok Kumar please send question pattern for NIC at godinall.kumar1@gmail.com or alok.iitb07@gmail.com

0 Answers  


Please send me Sample papers National Informatics Centre (NIC) Programmer. I am giving this paper first time..so if any one have previous question papers send to manoj200.yadav@gmail.com. thnx in advance

0 Answers   NIC,


Categories
  • Civil Engineering Interview Questions Civil Engineering (5085)
  • Mechanical Engineering Interview Questions Mechanical Engineering (4451)
  • Electrical Engineering Interview Questions Electrical Engineering (16632)
  • 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)