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

initializer is a constant value..so its not possible to
change the value at run time..

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of #define preprocessor in c?

1120


Write a C program on Centralized OLTP, Decentralized OLTP using locking mechanism, Semaphore using locking mechanism, Shared memory, message queues, channel of communication, sockets and a simple program on Saving bank application program using OLTP in IPC?

2756


Are there constructors in c?

1060


What is the maximum no. of arguments that can be given in a command line in C.?

1200


What is the use of sizeof () in c?

1099


Is it possible to execute code even after the program exits the main() function?

1393


What are the different types of endless loops?

1128


What is the use of f in c?

1032


Differentiate between ordinary variable and pointer in c.

1252


How can I do graphics in c?

1070


Explain about C function prototype?

1141


Write the control statements in C language

1279


Explain is it better to bitshift a value than to multiply by 2?

1247


Is the exit() function same as the return statement? Explain.

1157


Explain how can type-insensitive macros be created?

1043