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 / deepali

b

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Are pointers integer?

558


List some of the dynamic data structures in C?

794


Can stdout be forced to print somewhere other than the screen?

627


write a program that reads lines(using getline), converts each line to an integer using atoi, and computes the average of all the numbers read. also compute the standard deviation.

1989


Is c high or low level?

592






What is wrong with this declaration?

617


If the size of int data type is two bytes, what is the range of signed int data type?

596


What is restrict keyword in c?

649


Is array name a pointer?

610


Can we change the value of static variable in c?

568


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

819


What does *p++ do?

597


How can you read a directory in a C program?

662


What is the purpose of & in scanf?

606


What is the maximum no. of arguments that can be given in a command line in C.?

674