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 |
Find the error (2.5*2=5) (a) X=y=z=0.5,2.0-5.75 (b) s=15;
what is meant for variable not found?
I can not get my C++ program to work right. It is supposed to tell if a word is a palindrome or not, but it only tells thet the word is not a palindrome. And I can't fix it.
full c programming error question based problem
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.....
difference between c/c++ programing language? what is necessesity of c++ when existing c programing language?
UINT i,j; i = j = 0; i = ( i++ > ++j ) ? i++ : i--; explain pls....
char* f() return "hello:"; void main() {char *str=f(); }
what is macro in c? Difference between single linked list & double linked list what is fifo & lifo? what is stack & queue?
What are the different types of errors in C and when they occur?
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.
Write a C program to enter 10 integer numbers through one variable and count how many of them are even using while loop ?