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 / vignesh1988i
this code depends upon the value of 'n' actually....... if
the value is 4 the operation is differewnt... if 3 its
different..... so give the value of 'n'!
| Is This Answer Correct ? | 3 Yes | 2 No |
Post New Answer View All Answers
How is a null pointer different from a dangling pointer?
What type of function is main ()?
What is the hardest programming language?
In C language what is a 'dangling pointer'?
Why we use break in c?
A text file that contains declarations used by a group of functions,programs,or users a) executable file b) header file c) obj file d) .cfile
in any language the sound structure of that language depends on its a) character set, input/output function, its control structures b) character set, library functions, input/output functions its control structures c) character set, library functions, control sturctures d) character set, operators, its control structures
Explain what are the different data types in c?
write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.
C program execution always begins with a) #include b) comment (/*-------*/) c) main() d) declaration instructions
What is the purpose of scanf() and printf() functions?
Tell me when is a void pointer used?
What is c variable?
Explain what does the characters 'r' and 'w' mean when writing programs that will make use of files?
What is the use of pointers in C?