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

int main()
{
int i=1;
switch(i)
{
case '1':
printf("hello");
break;
case 1:
printf("Hi");
break;
case 49:
printf("Good Morning");
break;
}
return 0;
}

Answer Posted / vishnu nayak

it will display Hi. In case '1', 1 is a character and it is
converted into ascii equivalent and then tested, which is
not equal to 1.

if the code is like this
swithc(i)
{
case 1:
printf("hi");
break;
case 1:
printf("Hello ");
break;

} then it will surly give compilation error.

Is This Answer Correct ?    4 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

write a c program to calculate sum of digits till it reduces to a single digit using recursion

3318


How can you read a directory in a C program?

1149


What are the advantages of the functions?

1164


Explain what is page thrashing?

1106


any C program contains only one function, it must be a) void () b) main () c) message () d) abc ()

1131


What is pivot in c?

1033


Is main is user defined function?

1159


What is scanf_s in c?

1127


How many bytes are occupied by near, far and huge pointers (dos)?

1164


What is actual argument?

1069


Which is best book for data structures in c?

1096


Explain with the aid of an example why arrays of structures don’t provide an efficient representation when it comes to adding and deleting records internal to the array.

3156


Why is c so popular?

1167


a single linked list consists of nodes a to z .print the nodes in reverse order from z to a using recursion

2785


What are run-time errors?

1126