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;
}

Answers were Sorted based on User's Feedback



int main() { int i=1; switch(i) { case '1': printf("hello"); break; case..

Answer / srsabariselvan

The program Results in Error.
it will shows error "Duplicate case".
because '1' is equal to 49(ASCII of character 1).

Is This Answer Correct ?    8 Yes 0 No

int main() { int i=1; switch(i) { case '1': printf("hello"); break; case..

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

int main() { int i=1; switch(i) { case '1': printf("hello"); break; case..

Answer / hussain reddy

error because duplicate case values

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More C Interview Questions

What is the use of linkage in c language?

0 Answers  


Who is the main contributor in designing the c language after dennis ritchie?

0 Answers  


Explain c preprocessor?

0 Answers  


WHAT IS LOW LEVEL LANGUAGE?

2 Answers  


how to find string length wihtout using c function?

6 Answers  


ASCII stands for

1 Answers  


How can you increase the size of a statically allocated array?

0 Answers   TISL,


A routine usually part of the operation system that loads a program into memory prior to execution a) linker b) loader c) preprocessor d) compiler

0 Answers  


provide an example of the Group by clause, when would you use this clause

0 Answers  


Can the curly brackets { } be used to enclose a single line of code?

0 Answers  


What does the message "warning: macro replacement within a string literal" mean?

1 Answers  


i want to asked a question about c program the question is: create a c program that displays all prime numbers less than 500? using looping statement

5 Answers  


Categories