Given that two int variables, total and amount , have
been declared, write a sequence of statements that:
initializes total to 0
reads three values into amount , one at a time.
After each value is read in to amount , it is added to the
value in total (that is, total is incremented by the value
in amount ).
Instructor's notes: If you use a loop, it must be a for loop.
And if you use a loop control variable for counting, you
must declare it.
Answer / raj
total= 0;
scanf("%d",&amount);
total +=amount;
scanf("%d",&amount);
total +=amount;
scanf("%d",&amount);
total +=amount;
| Is This Answer Correct ? | 29 Yes | 16 No |
What are the different types of errors in C and when they occur?
#include<stdio.h> void main() { int i=1; printf("%d%d%d",i++,++i,i); }
what is the error in the following code: main() { int i=400,j; j=(i*i)/i; }
A sample program using data structure? what is file handling?
Find the error (2.5*2=5) (a) X=y=z=0.5,2.0-5.75 (b) s=15;
void main() { int i=5,y=3,z=2,ans; clrscr(); printf("%d",++i + --z + i++ + --i * ++y); i=5,y=3,z=2; ans=++i + --z + i++ + --i * ++y; printf("\n%d",ans); getch(); } Its output is 37 and 31.... Please explain me why its different How it works.....
What is the code for following o/p * * * * * * * * * * * * * * * *
Given an int variable n that has already been declared and initialized to a positive value, and another int variable j that has already been declared, use a do...while loop to print a single line consisting of n asterisks. Thus if n contains 5, five asterisks will be printed. Use no variables other than n and j .
wap for bubble sort
#include"stdio.h" #include"conio.h" void main() { int a; printf("\n enter a number:"); scanf("%c\n"); getch(); }
who was the present cheif governor of reserve bank of india
6 Answers State Bank Of India SBI,
Display this kind of output on screen. 1 0 1 1 0 1 3. Display this kind of output on screen. 1 1 0 1 0 1 4. Display this kind of output on screen. 1 1 0 1 0 1 5.Display this kind of output on screen. 1 2 3 4 5 6 7 8 9 10