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 / vikraman85

Here a is declared as static,so it can't be re-initialized..

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are inbuilt functions in c?

1022


What are examples of structures?

1084


What is a macro in c preprocessor?

1087


Write a program to check armstrong number in c?

1119


How can I send mail from within a c program?

1011


Explain how are portions of a program disabled in demo versions?

1104


What are the types of data files?

1188


Can we declare variable anywhere in c?

955


What is console in c language?

1087


What is an auto keyword in c?

1079


Once I have used freopen, how can I get the original stdout (or stdin) back?

1062


What is calloc in c?

1126


What is the use of a conditional inclusion statement in C?

1044


Write a program for Overriding.

1148


my project name is adulteration of chille powder.how can i explain it to the hr when he asks me about the project?

1581