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 / vikraman85
Here a is declared as static,so it can't be re-initialized..
| Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
What are inbuilt functions in c?
What are examples of structures?
What is a macro in c preprocessor?
Write a program to check armstrong number in c?
How can I send mail from within a c program?
Explain how are portions of a program disabled in demo versions?
What are the types of data files?
Can we declare variable anywhere in c?
What is console in c language?
What is an auto keyword in c?
Once I have used freopen, how can I get the original stdout (or stdin) back?
What is calloc in c?
What is the use of a conditional inclusion statement in C?
Write a program for Overriding.
my project name is adulteration of chille powder.how can i explain it to the hr when he asks me about the project?