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

void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }

1667


Declare the structure which contains the following members and write in C list of all students who score more than 75 marks. Roll No, Name, Father Name, Age, City, Marks.

1258


Which is better between malloc and calloc?

1120


Why do we use null pointer?

997


find the sum of two matrices and WAP for it.

1068


By using C language input a date into it and if it is right?

1021


How can I trap or ignore keyboard interrupts like control-c?

1020


Is python a c language?

948


Write a program to reverse a given number in c language?

1050


Why flag is used in c?

1068


What is local and global variable in c?

1128


If you know then define #pragma?

1054


explain what is fifo?

1027


What is the benefit of using an enum rather than a #define constant?

1172


Explain the difference between ++u and u++?

1068