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
What is the use of #define preprocessor in c?
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?
Are there constructors in c?
What is the maximum no. of arguments that can be given in a command line in C.?
What is the use of sizeof () in c?
Is it possible to execute code even after the program exits the main() function?
What are the different types of endless loops?
What is the use of f in c?
Differentiate between ordinary variable and pointer in c.
How can I do graphics in c?
Explain about C function prototype?
Write the control statements in C language
Explain is it better to bitshift a value than to multiply by 2?
Is the exit() function same as the return statement? Explain.
Explain how can type-insensitive macros be created?