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


Please Help Members By Posting Answers For Below Questions

Linked lists -- can you tell me how to check whether a linked list is circular?

648


What does the characters “r” and “w” mean when writing programs that will make use of files?

862


Are the variables argc and argv are local to main?

793


Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?

606


How can I send mail from within a c program?

583






What is a stream in c programming?

598


When is a “switch” statement preferable over an “if” statement?

653


how can I convert a string to a number?

600


Give me the code of in-order recursive and non-recursive.

889


What is the difference between call by value and call by reference in c?

621


What is meant by type specifiers?

663


How to set file pointer to beginning c?

672


How can you access memory located at a certain address?

670


What are header files and explain what are its uses in c programming?

616


Explain the use of 'auto' keyword

681