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

Write a program that takes a 5 digit number and calculates 2 power that number and prints it.

1 Answers   Mind Tree,


Why c is called top down?

0 Answers  


Tell me when would you use a pointer to a function?

0 Answers  


What is c language in simple words?

0 Answers  


Is it better to use a macro or a function?

0 Answers  






what is computer engg

1 Answers  


SRUCTURE PROGRAMMING

3 Answers   CTS, Wipro,


What is masking?

0 Answers  


What is a program flowchart?

0 Answers  


Can we assign string to char pointer?

0 Answers  


what is the difference between procedure oriented and object oriented progaming language

1 Answers  


Program to write some contents into a file using file operations with proper error messages.

2 Answers  


Categories