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

What are the features of tata nano , technical specification of tata nano, overview of tata nano, varients of tata nano, price of tata nano, dealers of tata nano, expectation from tata nano, criticism of tata nano, tata nano hybrid ?

0 Answers   TATA,


How can I boldly face the interview? Request:I am eagerly waiting for your replay.

0 Answers   Microsoft,


Q1 Design a webpage for a hotel which displays all the information of the hotel such as rooms available, facilities, and packages along with rate list. Apply the different tags available to give it a good style.

0 Answers  


how to hack email id & passward

0 Answers  


how to count 4 column with two "and" condition in oracle? e.g task_type and cust_type and service_type are 3 column and we hv to count where task_type="new"and cust_type="jdp" and resulting column name will be new cust with jdp..and also we hv to count where task_type="new"and service_type="fs" resulting column name will be new cust with fs..

0 Answers  






What do you mean by component versionig?

0 Answers  


I am from B.Tech back ground, i had Applied to do masters in Engineering management, and university gave Admission and sent I-20, if the interviewer asks why are doing masters in this field, even you are from B.Tech (information technology)? Can any one give me relevant answer, if interviewer asks that question

0 Answers   US Consulate,


Let an denote the number of bit strings of length n that do not have two consecutive zeroes. Find a recurrence relation for the number of bit strings of length n that do not have two consecutive zeroes. Hence find a4.

0 Answers  


a steel bar 1' inch square 6' long is to be used as a column.ends are free to rotate put may not be displaced.stress is limited to 30,000 PSI

0 Answers  


What are special features of Silk Test ? In what way it is advanced than QTP?

0 Answers  


Explain what are db_options used for?

0 Answers  


What is the strongest naturally occurring material and how can it be cut?

0 Answers  


Categories
  • Civil Engineering Interview Questions Civil Engineering (5084)
  • Mechanical Engineering Interview Questions Mechanical Engineering (4451)
  • Electrical Engineering Interview Questions Electrical Engineering (16631)
  • Electronics Communications Interview Questions Electronics Communications (3918)
  • Chemical Engineering Interview Questions Chemical Engineering (1094)
  • 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)