Originally Posted by
Salem
> for (i=1; i<3; i++);
What part of remove the trailing ; is confusing you?
ok got it
Code:
#include <stdio.h>
int main ()
{
int i;
for (i=0; i<4; i++)
switch(i)
{
case task:
{
printf("name \n");
}
break;
case 2:
{
printf("age \n");
}
break;
case 3:
{
printf("address \n");
}
break;
}
}
now I want add enum with switch case
Code:
typedef enum
{
male,
female,
child,
}database
I am not sure that I am using enum in correct way
Code:
#include<stdio.h>
typedef enum
{
male,
female,
child,
}database;
int main ()
{
int i=male;
for (i=0; i<4; i++)
switch(i)
{
case 1:
{
printf("name \n");
}
break;
case 2:
{
printf("age \n");
}
break;
case 3:
{
printf("address \n");
}
break;
}
return 0;
}