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 does it mean when a pointer is used in an if statement?
Why functions are used in c?
what is event driven software and what is procedural driven software?
How do we print only part of a string in c?
Write a C program linear.c that creates a sequence of
processes with a given length. By
sequence it is meant that each created process has exactly
one child.
Let's look at some example outputs for the program.
Here the entire process sequence consists of process 18181:
Sara@dell:~/OSSS$ ./linear 1
Creating process sequence of length 1.
18181 begins the sequence.
An example for a sequence of length three:
Sara@dell:~/OSSS$ ./linear 3
Creating process sequence of length 3.
18233 begins the sequence.
18234 is child of 18233
18235 is child of 18234
........ this is coad .... BUt i could not compleate it .....:(
#include
a way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none
Is javascript written in c?
a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above
What is echo in c programming?
What will the code below print when it is executed? int x = 3, y = 4; if (x = 4) y = 5; else y = 2; printf ("x=%d, y=%d ",x,y);
What is the full form of getch?
How many types of arrays are there in c?
What are the advantages of using new operator as compared to the function malloc ()?
Differentiate between the = symbol and == symbol?
Why c is called object oriented language?