Search
 
SCRIPT & CODE EXAMPLE
 

C

enum in c

#include <stdio.h>

enum week {Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday};

int main()
{
    // creating today variable of enum week type
    enum week today;
    today = Wednesday;
    printf("Day %d",today+1);
    return 0;
}
Comment

enum in c language

// An example program to demonstrate working
// of enum in C
#include<stdio.h>
 
enum week{Mon, Tue, Wed, Thur, Fri, Sat, Sun};
 
int main()
{
    enum week day;
    day = Wed;
    printf("%d",day);
    return 0;
}
Comment

C enums

enum flag {const1, const2, ..., constN};
Comment

C Why enums are used?

#include <stdio.h>

enum suit {
    club = 0,
    diamonds = 10,
    hearts = 20,
    spades = 3
} card;

int main() 
{
    card = club;
	printf("Size of enum variable = %d bytes", sizeof(card));	
	return 0;
}
Comment

PREVIOUS NEXT
Code Example
C :: abs() for floting point in C 
C :: OpenDaylight maven settings 
C :: libreoffice reference cell in different sheet with sheet name with space 
C :: code_art_bcm_10.c 
C :: Print Characters 
C :: remove every appearance of char without malloc in c 
C :: Uri/beecrowd problem no - 1131 solution in C 
C :: c to assembly converter online 
C :: Integer Xor swap 
C :: Writing tests for API requests 
C :: pdo crud 
C :: (avar == 1) ? (bvar == 2 ? result = 3 : (result = 5);) : (result = 0); 
C :: get flag status c code 
C :: Integer Input/Output 
C :: what to do after autoencoder training 
C :: Print fabionci with fork in C 
C :: reap zombie process in c 
C :: debian9 remove pack 
C :: email dev Microsoft Outlook 2007 items all aligned left or aligned wrong 
C :: change variable type in c 
C :: calculate max of three numbers using ternary operator in c 
C :: website how to solve c programming questions 
Dart :: round corner of alertdialog flutter 
Dart :: flutter get current date 
Dart :: rounded borders for container in flutte 
Dart :: color of status bar flutter 
Dart :: flutter get device width 
Dart :: flutter dropdown button remove underline 
Dart :: dart command to stop program 
Dart :: dart read from terminal 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =