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 / subbu
gives an error because at the time of initialization we
should not use variables, we can use only constants at the
time of initialization.
| Is This Answer Correct ? | 4 Yes | 3 No |
Post New Answer View All Answers
What is main () in c?
‘ C’ PROGRAME TO SHOW THE TYPE OF TRANGLE BY ACCEPTING IT’S LENGTH .
What is the mean of function?
Is there a built-in function in C that can be used for sorting data?
Does c have function or method?
Write a code to generate a series where the next element is the sum of last k terms.
What is && in c programming?
What is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?
Explain threaded binary trees?
Is swift based on c?
Explain what is a static function?
Can include files be nested?
What is difference between union and structure in c?
Explain about C function prototype?
What is meant by type casting?