Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

#include
main()
{
int i=1,j=2;
switch(i)
{
case 1: printf("GOOD");
break;
case j: printf("BAD");
break;
}
}

Answer Posted / surenda pal singh chouhan

Compiler Error: Constant expression required in function
main.

Explanation:
The case statement can have only constant expressions (this
implies that we cannot use variable names directly so an
error).
Note:
Enumerated types can be used in case statements.

Is This Answer Correct ?    10 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does c have circular shift operators?

1236


how is the examination pattern?

2019


What is the deal on sprintf_s return value?

1138


What is bash c?

1012


What is dynamic memory allocation?

1337


What is new line escape sequence?

1353


What are the types of data structures in c?

1155


What is wrong with this initialization?

1007


How do you list files in a directory?

1144


What are the three constants used in c?

995


write a program to find the given number is prime or not

4766


Define the scope of static variables.

1132


Explain is it valid to address one element beyond the end of an array?

1218


Write a program in "C" to calculate the root of a quadratic equation ax^2+bx+c=0, where the value of a,b & c are known.

2236


What is scope rule in c?

1066