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
what are the Types of End User in dbms?
what's the difference between windows serevr 2003 or windows XP.
What is the meaning of "co relation" and what is the value of "co relation" in the performance testing environment.
int main() { int d = 10; int m = 2; int y = 3603; int c = 0; int val; val = ( d + m + y + (y/4) + c) % 7; cout << val; return 0; }
write a c programme to count the characters words and lines in a text book
am looking for ms,i got ielts score 5.5,and i dont have english score 60 in any any year.tell me can i get offer lettr from any university.is i am elegible..?
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
what is defect tracking in sotware testing
how to cable size by Amp with example
4. What is your typical way of dealing with conflict?
what is a structure in c language?
sir ,,kindly provide me 10 year old solved question papers of gate ,i am from CS. branch...
What does "stdafx"header file do?
wats the difference between RS latch using NAND n NOR gate? which is to be preffered?
when does the official confirmation or the offer letter for the 2012 selected candidates of HUAWEI will come??