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 / subbu
gives an error because at the time of initialization we
should not use variables, we can use only constants at the
time of initialization.
| Is This Answer Correct ? | 4 Yes | 3 No |
Post New Answer View All Answers
explain what are pointers?
write a c program to find the largest and 2nd largest numbers from the given n numbers without using arrays
a) Identify the following declarations. Ex. int i (integer variable) float a[l0](array of 10 real nos) int (*f())() void *f int (*f()) [] void *f int f[] [] [] char *(*f) () int (*f[]) [] float(*f) [] [] float **f int ******f
Explain what are the different file extensions involved when programming in c?
How would you use the functions fseek(), freed(), fwrite() and ftell()?
What is storage class?
How can you check to see whether a symbol is defined?
What are conditional operators in C?
What is f'n in math?
Write a code to generate divisors of an integer?
State two uses of pointers in C?
Do you have any idea how to compare array with pointer in c?
Is null always defined as 0(zero)?
What is the difference between arrays and pointers?
What is a program?