-
The Switch Statement
I am writing the following Switch Statement
switch( Choice )
{
case 1;
Num=Rational();
printf("%f",Num);
break;
case 2;
cp=String();
puts(cp);
break;
case 3;
break;
can anyonet ell me why Im getting the following compilation error:
"Missing ';' before ';'
Thanks
-
You Are using Semi Colon (;) for case... It should be a ":"
So, ur code should be...
switch( Choice )
{
case 1:
Num=Rational();
printf("%f",Num);
break;
case 2:
cp=String();
puts(cp);
break;
case 3:
break;
- - -
}
Regards,
Sriharsha
-
The Siwtch Statement