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
i want questions only on code part like general logics in c and java
how do we calculate physical address if logical address is given in the question?
where is the first engeenering college of Asia
5. Can you work well under deadlines or pressure?
what are nanoemulsions and how are they prepared? i want a brief outline about nanoemulsions.. is anyone of you is having any literature, can you share that? also any an idea where i can get the information?
3. Tell me about a time when you had too many things to do and you were required to prioritize your tasks.
Is there any difference between the concepts of encoding,decoding and encryption and decryption?
what is program data insulation in dbms?
what is elligibility criteria of hcl?
WHAT HAPPEN WHEN ANY SPINDLE RUN OVER 10 MM HEIGHT ABOVE BOLSTAR IN RING SPINNING FRAME
i m doing engg in IT .for getting job which courses i have to do?
how strcpy usingrecursive function
write a program for reverse a given string?
minimum percentage in B.E in(INFORMATION TECHNOLOGY) to be eligible for IES exam qualification and also for reserved categories.are IT engineers are eligible for giving IES exams? please reply soon.
Write a c pgm to print the letter as per given condition i.e.. if u give 4 out put should b 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4