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
What is far pointer in c?
What is the value of a[3] if integer a[] = {5,4,3,2,1}?
What would be an example of a structure analogous to structure c?
What is #error and use of it?
What is a program flowchart and explain how does it help in writing a program?
What is binary tree in c?
Which is better oop or procedural?
How do you sort filenames in a directory?
Simplify the program segment if X = B then C ← true else C ← false
What is the difference between āgā and āgā in C?
Find duplicates in a file containing 6 digit number (like uid) in O (n) time.
Define C in your own Language.
What is scope rule in c?
Can we declare a function inside a function in c?
When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?