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 / vignesh1988i
this code depends upon the value of 'n' actually....... if
the value is 4 the operation is differewnt... if 3 its
different..... so give the value of 'n'!
Is This Answer Correct ? | 3 Yes | 2 No |
Post New Answer View All Answers
Linked lists -- can you tell me how to check whether a linked list is circular?
What does the characters “r” and “w” mean when writing programs that will make use of files?
Are the variables argc and argv are local to main?
Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
How can I send mail from within a c program?
What is a stream in c programming?
When is a “switch” statement preferable over an “if” statement?
how can I convert a string to a number?
Give me the code of in-order recursive and non-recursive.
What is the difference between call by value and call by reference in c?
What is meant by type specifiers?
How to set file pointer to beginning c?
How can you access memory located at a certain address?
What are header files and explain what are its uses in c programming?
Explain the use of 'auto' keyword