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

gives an error because at the time of initialization we
should not use variables, we can use only constants at the
time of initialization.

Is This Answer Correct ?    4 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor

2988


What is the meaning of && in c?

552


write a program to create a sparse matrix using dynamic memory allocation.

4375


what type of questions arrive in interview over c programming?

1562


Can a pointer be static?

628






Should I learn c before c++?

624


Badboy is defined who has ALL the following properties: Does not have a girlfriend and is not married. He is not more than 23 years old. The middle name should be "Singh" The last name should have more than 4 characters. The character 'a' should appear in the last name at least two times. The name of one of his brothers should be "Ram" Write a method: boolean isBadBoy(boolean hasGirlFriend , boolean isMarried, int age , String middleName , String lastName , String[] brotherName); isHaveGirlFriend is true if the person has a girlfriend isMarried is true if the person is married age is the age of the person middleName is the middle name of the person lastName is the last name of the person brotherName is the array of the names of his brothers

1426


What is the general form of #line preprocessor?

590


What is a stream water?

661


Why do we use & in c?

595


What is the difference between array and pointer?

571


a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list

634


How the c program is executed?

635


Write a code to determine the total number of stops an elevator would take to serve N number of people.

733


What does stand for?

601