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
How can I discover how many arguments a function was actually called with?
Explain what are its uses in c programming?
What is wild pointer in c with example?
What is the advantage of an array over individual variables?
What is mean by data types in c?
Differentiate between static and dynamic modeling.
What is malloc() function?
Why is sprintf unsafe?
how to write a c program to print list of fruits in alpabetical order?
write a program to print the consecutive repeated character from the given string... input string is : hhhhjkutskkkkkggggj output should be like this: hhhhkkkkkgggg anyone help me...
all c language question
Do you know what are bitwise shift operators in c programming?
What is getch() function?
where are auto variables stored? What are the characteristics of an auto variable?
List the difference between a 'copy constructor' and a 'assignment operator' in C?