what does the following code do?
fn(int n,int p,int r)
{
static int a=p;
switch(n){
case 4:a+=a*r;
case 3:a+=a*r;
case 2:a+=a*r;
case 1:a+=a*r;
}
}
a.computes simple interest for one year
b.computes amount on compound interest for 1 to 4 years
c.computes simple interest for four year
d.computes compound interst for 1 year
Answer Posted / deepali
b
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
Sir i need notes for structure,functions,pointers in c language can you help me please
When should the const modifier be used?
Is using exit() the same as using return?
What is pragma c?
the portion of a computer program within which the definition of the variable remains unchanged a) mode b) module c) scope d) none
What is volatile keyword in c?
What is assignment operator?
What is #define used for in c?
Which of these functions is safer to use : fgets(), gets()? Why?
Ow can I insert or delete a line (or record) in the middle of a file?
Explain how can I write functions that take a variable number of arguments?
Is array a primitive data type in c?
What is an expression?
What are the types of c language?
Write a function stroverlap that takes (at least) two strings, and concatenates them, but does not duplicate any overlap. You only need to worry about overlaps between the end of the first string and the beginning of the second string. Examples: batman, manonthemoon = batmanonthemoon batmmamaman, mamamanonthemoon = batmmamamanonthemoon bat, man = batman batman, batman = batman batman, menonthemoon = batmanmenonthemoon