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

d.computes compound interest for 1 year

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the role of && operator in a program code?

568


PROGRAM TO WRITE CONTENTS OF 1 FILE IN REVERSE TO ANOTHER FILE,PROGRAM TO COPY 1 FILE TO ANOTHER BY SPECIFYING FILE NAMES AS COMMAND LINE

1470


What is the difference between array and pointer in c?

581


Q.1 write a program to create binary tree 1 to 16 numbers? Q.2 write a program to creat a binary search tree for the member that is given by user?

2055


Which is the memory area not included in C program? give the reason

1508






Tell me what are bitwise shift operators?

658


What are structural members?

574


What does the file stdio.h contain?

608


Why can arithmetic operations not be performed on void pointers?

590


What is enumerated data type in c?

627


What is pre-emptive data structure and explain it with example?

3211


Write a C program on Centralized OLTP, Decentralized OLTP using locking mechanism, Semaphore using locking mechanism, Shared memory, message queues, channel of communication, sockets and a simple program on Saving bank application program using OLTP in IPC?

2173


When should a far pointer be used?

604


What is the use of void pointer and null pointer in c language?

629


What is a buffer in c?

575