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
What are the advantages of Macro over function?
code for quick sort?
explain what is a newline escape sequence?
If the size of int data type is two bytes, what is the range of signed int data type?
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?
Stimulate calculator using Switch-case-default statement for two numbers
Explain what will the preprocessor do for a program?
what do you mean by enumeration constant?
What is difference between static and global variable in c?
What is meant by realloc()?
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?
Can a void pointer point to a function?
what is bit rate & baud rate? plz give wave forms
Write a program to swap two numbers without using the third variable?
how to write optimum code to divide a 50 digit number with a 25 digit number??