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 / mani thangaraj
I feel it as d.computes compound interest for one
year.because of switch statement any one of the four gets
executed .. and it seems to be C.I
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Write an efficient algo and C code to shuffle a pack of cards.. this one was a feedback process until we came up with one with no extra storage.
What is time null in c?
Is file a keyword in c?
In c programming, explain how do you insert quote characters (? And ?) Into the output screen?
write a program that declares an array of 30 elements named "income" in the main functions. then cal and pass the array to a programmer-defined function named "getIncome" within the "getIncome" function, ask the user for annual income of 30 employees. then calculate and print total income on the screen using the following function: "void getIncome ( ai []);
What is the difference between test design and test case design?
What is the difference between struct and typedef struct in c?
Write a C Program That Will Count The Number Of Even And Odd Integers In A Set using while loop
What is #line in c?
what is the basis for selection of arrays or pointers as data structure in a program
What is return in c programming?
How can a number be converted to a string?
I came across some code that puts a (void) cast before each call to printf. Why?
What is int main () in c?
Can we assign string to char pointer?