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
Write a program to compute the similarity between two strings - The program should get the two strings as input - Then it will output one single number which is the percentage of similarity between the two strings
How can I sort more data than will fit in memory?
What is the deal on sprintf_s return value?
What does dm mean sexually?
What is a pointer on a pointer in c programming language?
Explain what are header files and explain what are its uses in c programming?
Do you know null pointer?
Why we use void main in c?
You are to write your own versions of strcpy() and strlen (). Call them mystrcpy() and mystrlen(). Write them first as code within main(), not as functions, then, convert them to functions. You will pass two arrays to the function in the case of mystrcpy(), the source and target array.
What is the use of sizeof?
How do I send escape sequences to control a terminal or other device?
Describe how arrays can be passed to a user defined function
please help me..... please codes and flowchart plz turbo c lang po yan.....please asap response... 3. Make an astrology program. The user types in his or her birthday (month, day, and year as integer), and the program responds with the user’s zodiac sign, horoscope, and other information related to it. If the user’s birth year falls into a leap year, your program should display an appropriate message for it. NOTES: Conditional Statements: it should be with graphics
How is a pointer variable declared?
Explain what is meant by high-order and low-order bytes?