RUVIDEO
Поделитесь видео 🙏

Enumerations or enum in C || Lesson 86 || C Programming || Learning Monkey ||

Enumerations or enum in C

In this class, we will understand Enumerations or enum in C.

We have discussed the concepts of comments.


Enumerations or enum in C
Example 1

Enumerations are used to assign names to integral constants, making a program easy to read and maintain.


We have created two enumerations, boolean and weeks.

The wrong and right are provided as the names for integer constants, but where are the integers?

How do enumerations work?

By default, the first name in the definition is provided a value of 0. The second name provided a value of one so on so forth.


Let us try to understand the concept of enumerations in depth by using the example shown below.


In the above example, 0 is provided the name Mon, and one is provided the name Tue, so on.

But we want to assign Mon to 1, and 2 to Tue and so on.

We have created a variable day for enumeration week, and the day is assigned Wed.

When we print, day two will get published.

The default assignments can be changed, as shown below.

enum weeks = {Mon=1, Tue, Wed, Thu, Fri, Sat, Sun};

Now one is assigned to Mon, and Two is set to Tue, so on.

For example, we want to assign a ‘ten’ integer with Thu’s name.

Check the code below.

enum weeks = {Mon = 1, Tue, Wed, Thu = 10, Fri, Sat, Sun};

Now, one is assigned Mon; two is assigned Tue; Three is assigned Wed; ten is assigned Thu; eleven is assigned Fri and so on.
Example 2


In the above example, the names assigned to the integer constants are used to iterate the ‘for loop.’


#learningmonkey #cprogrammingforbeginners #placements #gatecse #cprogramming #cprogramminglanguage






Link for playlists:
https://www.youtube.com/channel/UCl8x4Pn9Mnh_C1fue-Yndig/playlists


Link for our website: https://learningmonkey.in

Follow us on Facebook @ https://www.facebook.com/learningmonkey

Follow us on Instagram @ https://www.instagram.com/learningmonkey1/

Follow us on Twitter @ https://twitter.com/_learningmonkey

Mail us @ [email protected]

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Enumerations or enum in C || Lesson 86 || C Programming || Learning Monkey ||», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.