wat is output of the following

int main()
{
const int j=2;
int i;
switch(i)
{
case 1:break;
case j:break;
default:break;
}
}

Answers were Sorted based on User's Feedback



wat is output of the following int main() { const int j=2; int i; switch(i) ..

Answer / kalyan chukka

Error Generated Because Case j is invalid declaration so
error generated

Is This Answer Correct ?    15 Yes 1 No

wat is output of the following int main() { const int j=2; int i; switch(i) ..

Answer / vikash gaurav

output will be nothing.... since i will have garbage value.
once going to switch case the value will not match with any
case so default value will be executed.

Is This Answer Correct ?    10 Yes 2 No

Post New Answer

More C Interview Questions

How the processor registers can be used in C ?

7 Answers   HP,


Which header file is essential for using strcmp function?

0 Answers  


Are enumerations really portable?

0 Answers  


Define Spanning-Tree Protocol (STP)

0 Answers  


What are called c variables?

0 Answers  


coding for Fibonacci.?

1 Answers  


What is a struct c#?

0 Answers  


What are the advantages and disadvantages of c language?

0 Answers  


What does sizeof int return?

0 Answers  


What is f'n in math?

0 Answers  


what is difference between array and structure?

44 Answers   College School Exams Tests, CTS, Google, HCL, IBM, Motorola, TCS,


what is unsigened char and what is the difference from char

2 Answers  


Categories