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...

Result of the following program is
main()
{
int i=0;
for(i=0;i<20;i++)
{
switch(i)
case 0:i+=5;
case 1:i+=2;
case 5:i+=5;
default i+=4;
break;}
printf("%d,",i);
}
}
a)0,5,9,13,17
b)5,9,13,17
c)12,17,22
d)16,21
e)syntax error

Answer Posted / arvind

the answer is syntax error but if there was a : after default

the execution would be like:
for i=0 case 0 is executed and then since there is no break
statement all the cases including the default case are
executed and the 16 is printed,.then i is iterated using
i++, now i=17 ,it enters the switch statement and only
default case is executed and i=i+5=21 is printed

Is This Answer Correct ?    37 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I discover how many arguments a function was actually called with?

1070


Why does the call char scanf work?

1208


What is the meaning of && in c?

1021


What are the different data types in C?

1205


Can we assign integer value to char in c?

1254


What are the types of pointers?

1115


What are the main characteristics of c language describe the structure of ac program?

1212


What is struct node in c?

1075


Tell me what is the purpose of 'register' keyword in c language?

1012


How do you list a file’s date and time?

1070


What are the types of macro formats?

1125


Explain what standard functions are available to manipulate strings?

1076


how to execute a program using if else condition and the output should enter number and the number is odd only...

2302


Explain bit masking in c?

1141


formula to convert 2500mmh2o into m3/hr

1000