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 / vikraman85
Here a is declared as static,so it can't be re-initialized..
| Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }
Declare the structure which contains the following members and write in C list of all students who score more than 75 marks. Roll No, Name, Father Name, Age, City, Marks.
Which is better between malloc and calloc?
Why do we use null pointer?
find the sum of two matrices and WAP for it.
By using C language input a date into it and if it is right?
How can I trap or ignore keyboard interrupts like control-c?
Is python a c language?
Write a program to reverse a given number in c language?
Why flag is used in c?
What is local and global variable in c?
If you know then define #pragma?
explain what is fifo?
What is the benefit of using an enum rather than a #define constant?
Explain the difference between ++u and u++?