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
What is null character in c?
What are high level languages like C and FORTRAN also known as?
How is a macro different from a function?
What is structure in c definition?
What is static function in c?
What are the standard predefined macros?
What is difference between array and pointer in c?
Explain what is the advantage of a random access file?
Describe the steps to insert data into a singly linked list.
Explain can you assign a different address to an array tag?
Explain 'bit masking'?
HOW TO SOLVE A NUMERICAL OF LRU IN OS ??????
What is call by value in c?
What is a method in c?
any restrictions have on the number of 'return' statements that may be present in a function. a) no restriction b) only 2 return statements c) only 1 return statements d) none of the above