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
Explain how can you determine the size of an allocated portion of memory?
Give differences between - new and malloc() , delete and free() ?
Can we assign integer value to char in c?
write a c program to do the following: a) To find the area of a triangle. b) To convert the temperature from Fahrenheit to Celsius. c) To convert the time in hours : minutes : seconds to seconds.
Explain the process of converting a Tree into a Binary Tree.
Write an algorithm for implementing insertion and deletion operations in a singly linked list using arrays ?
Whats s or c mean?
Can the curly brackets { } be used to enclose a single line of code?
The statement, int(*x[]) () what does in indicate?
What does 4d mean in c?
Create a simple code fragment that will swap the values of two variables num1 and num2.
an expression contains relational operators, assignment operators, and arithmatic operstors. In the absence of parentheses, they will be evaluated in which of the following order a) assignment, relational, arithematic b) arithematic, relational, assignment c) relational, arithematic, assignment d) assignment, arithematic, relational
Can we compile a program without main() function?
What is %d called in c?
Can a void pointer point to a function?