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 are the advantages of using macro in c language?
Can you think of a logic behind the game minesweeper.
Explain how do you determine the length of a string value that was stored in a variable?
What is the difference between the local variable and global variable in c?
What is a class c rental property?
What is function prototype in c with example?
How can I write a function that takes a format string and a variable number of arguments?
Can 'this' pointer by used in the constructor?
the factorial of non-negative integer n is written n! and is defined as follows: n!=n*(n-1)*(n-2)........1(for values of n greater than or equal to 1 and n!=1(for n=0) Perform the following 1.write a c program that reads a non-negative integer and computes and prints its factorial. 2. write a C program that estimates the value of the mathematical constant e by using the formula: e=1+1/!+1/2!+1/3!+.... 3. write a c program the computes the value ex by using the formula ex=1+x/1!+xsquare/2!+xcube/3!+....
Why string is used in c?
What is data structure in c programming?
What is a stream?
write a program to copy the string using switch case?
How to compare array with pointer in c?
What is the difference between malloc() and calloc() function in c language?