Write a C program of fonts using enumeration.
enum designFlags
{
BOLD = 1, ITALICS = 2, UNDERLINE = 3, STRIKE = 4;
};
Runtime Input :
1
Output :
BOLD
#include <stdio.h>
enum designFlags {BOLD = 1, ITALICS = 2, UNDERLINE = 3, STRIKE = 4};
int main(){
int selectedDesignFlags;
scanf("%d",&selectedDesignFlags);
switch(selectedDesignFlags){
case BOLD:
printf("BOLD\n\n");
break;
case ITALICS:
printf("ITALICS\n\n");
break;
case UNDERLINE:
printf("UNDERLINE\n\n");
break;
case STRIKE:
printf("STRIKE\n\n");
break;
}
getchar();
getchar();
return 0;
}
Comments
Leave a comment