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
Why does this code crash?
Write a program to print all permutations of a given string.
What is substring in c?
Write a program, where i have a grid with many cells, how many paths are possible from one point to other desired points.
write a c program for swapping two strings using pointer
What is the use of getchar() function?
Explain 'far' and 'near' pointers in c.
List out few of the applications that make use of Multilinked Structures?
Differentiate between full, complete & perfect binary trees.
What is the difference between the local variable and global variable in c?
Can you apply link and association interchangeably?
What are the __date__ and __time__ preprocessor commands?
Why c is faster than c++?
Explain what is the difference between functions abs() and fabs()?
Is c is a middle level language?