#include
main()
{
int i=1,j=2;
switch(i)
{
case 1: printf("GOOD");
break;
case j: printf("BAD");
break;
}
}
Answer Posted / pravin
if we use the single qutoes' 'at 1 and j the rest of
program is right because we already decleared the value of i
and i=1 .
so output should be "GOOD" only. (without" ")
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
The % symbol has a special use in a printf statement. How would you place this character as part of the output on the screen?
What is wrong with this program statement? void = 10;
Can we declare variables anywhere in c?
What is the difference between pure virtual function and virtual function?
Write a program to swap two numbers without using third variable?
A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers
How many data structures are there in c?
What is wrong in this statement?
What is meant by operator precedence?
Write a C program that will accept a hexadecimal number as input and then display a menu that will permit any of the following operations to be carried out: Display the hexadecimal equivalent of the one's complement. (b) Carry out a masking operation and then display the hexadecimal equivalent of the result. (c) Carry out a bit shifting operation and then display the hexadecimal equivalent of the result. (d) Exit. If the masking operation is selected, prompt the user lor the type of operation (bitwise and, bitwise exclusive or, or bitwise or) and then a (hexadecimal) value for the mask. If the bit shifting operation is selected. prompt the user for the type of shift (left or right), and then the number of bits. Test the program with several different (hexadecimal) input values of your own choice.
Explain do array subscripts always start with zero?
Can include files be nested? How many levels deep can include files be nested?
Write a program to swap two numbers without using the third variable?
Can you return null in c?
What is the difference between arrays and pointers?