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 / eswaran
initializer is a constant value..so its not possible to
change the value at run time..
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What does 3 periods mean in texting?
Do you know the difference between exit() and _exit() function in c?
What is a shell structure examples?
is it possible to create your own header files?
When should structures be passed by values or by references?
How can I write a function that takes a format string and a variable number of arguments?
What does volatile do?
what is the role you expect in software industry?
Why c is called procedure oriented language?
Explain the use of 'auto' keyword in c programming?
how do you write a function that takes a variable number of arguments? What is the prototype of printf () function?
What are the 5 types of organizational structures?
When was c language developed?
What is variable in c example?
What is the concatenation operator?