Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What are directives in c?

947


What is use of integral promotions in c?

1126


What is data types?

1064


What does c mean?

1019


A variable that is defined in a specified portion of a program but can be used throughout the program a) global variable b) local variable c) character d) none

1218


Differentiate between #include<...> and #include '...'

1041


.main() { char *p = "hello world!"; p[0] = 'H'; printf("%s",p); }

1270


What is a c token and types of c tokens?

1040


Can we use visual studio for c?

1065


What is realloc in c?

1064


What are the valid places to have keyword “break”?

1077


What is the difference between int main and void main?

1031


Explain why can’t constant values be used to define an array’s initial size?

1341


What is the difference between call by value and call by reference in c?

1151


Explain the properties of union. What is the size of a union variable

1173