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
What is a pointer on a pointer in c programming language?
What is c basic?
What are the benefits of c language?
Why is not a pointer null after calling free?
Differentiate between the expression “++a” and “a++”?
What is dynamic memory allocation?
What is C language ?
How do you search data in a data file using random access method?
Should I learn c before c++?
What is the equivalent code of the following statement in WHILE LOOP format?
Explain what will the preprocessor do for a program?
What is a volatile keyword in c?
What are type modifiers in c?
How will you delete a node in DLL?
What are the types of pointers in c?