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
Draw a pipeline configuration to carryout the following operations on the arrays of data represented by A, B, C, D, E and F. (A i represents the i th element of the array). (Ai × Bi + Ci × Di ) (Ei × Fi ) Show the content of the pipline for i = 1 to 5
i can access command prompt in my pc. when i type cmd in run,message comes-you are restricted.contact admin. why is it so? how can acces it by just logging in as a user and not as admin.?????
An inversion is an array of numbers is any pair (i,j) such
that i
what is different between static block and public static void main??
Why do large ships like aircraft carriers not sink despite weighing several thousand tonnes?
How many VLANs are supported on a single switch
how to hack email id & passward
how to print a number in character(ex. 123= one twenty three)?
What are the input documents to 1.Functional testing,2.System testing and 3.Integration testing. Whether there will be separate test cases for regression testing or functional testing?
can i get some win vista notes
Modal vs Modaless in VB??
Implement the dictionary operations INSERT, DELETE, and SEARCH using singly linked, circular lists. What are the running times of your procedures?
what are the steps u follow to create an custom idoc program in which environment u create the program?
Problem:Design and implement a class that allows a teacher to track the grades in a single ourse.Include methods that calculate the average grae, the highest grade, and the lowest grade.Wrute a program to testyour class implementation in a c#. given grades:integral=85, physics=87, datastruct=84.
what is compiler