Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 / mani thangaraj

I feel it as d.computes compound interest for one
year.because of switch statement any one of the four gets
executed .. and it seems to be C.I

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I invoke another program (a standalone executable, or an operating system command) from within a c program?

1218


How can I find out the size of a file, prior to reading it in?

1180


Write programs for String Reversal & Palindrome check

1064


What are the 4 types of unions?

1046


Explain what does the characters 'r' and 'w' mean when writing programs that will make use of files?

1254


What is the difference between a function and a method in c?

1088


write a c program to do the following: a) To find the area of a triangle. b) To convert the temperature from Fahrenheit to Celsius. c) To convert the time in hours : minutes : seconds to seconds.

1995


How will you find a duplicate number in a array without negating the nos ?

2135


Tell us two differences between new () and malloc ()?

1197


Write a program to know whether the input number is an armstrong number.

1129


which of the following is allowed in a "C" arithematic instruction a) [] b) {} c) () d) none of the above

1728


What are the advantages of using linked list for tree construction?

1104


What is the use of function overloading in C?

1178


Write a program to print "hello world" without using a semicolon?

1066


what are bit fields? What is the use of bit fields in a structure declaration?

2137