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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the advantages of Macro over function?

1209


code for quick sort?

1624


explain what is a newline escape sequence?

692


If the size of int data type is two bytes, what is the range of signed int data type?

596


1) There is a singing competition for children going to be conducted at a local club. Parents have been asked to arrive at least an hour before and register their children’s names with the Program Manager. Whenever a participant registers, the Program Manager has to position the name of the person in a list in alphabet order. Write a program to help the Program Manager do this by placing the name in the right place each time the Program Manger enters a name. The Logic should be written in Data Structures?

1921






Stimulate calculator using Switch-case-default statement for two numbers

2451


Explain what will the preprocessor do for a program?

607


what do you mean by enumeration constant?

601


What is difference between static and global variable in c?

541


What is meant by realloc()?

680


Write a program to input the price of 1 burger and the number of burgers eaten by a group of friends .print the total amount to be paid by the group?

580


Can a void pointer point to a function?

576


what is bit rate & baud rate? plz give wave forms

1523


Write a program to swap two numbers without using the third variable?

601


how to write optimum code to divide a 50 digit number with a 25 digit number??

2757