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(){
enum designFlags design = STRIKE;
if(design==1){
printf("BOLD");
}
else if(design == 2){
printf("ITALICS");
}
else if(design == 3){
printf("UNDERLINE");
}
else if(design == 4){
printf("STRIKE");
}
}
Comments
Leave a comment