Rules for Declaring Variables, Identifiers in C Language | Comments in C Programming

preview_player
Показать описание


Variables are like boxes that hold information in a program. They can store different types of data, like numbers or text. Identifiers, on the other hand, are names that are given to these variables so they can be easily identified and used in a program.

To declare a variable in C, we have to follow some rules. First, we have to choose a valid identifier name for the variable. This meant using only letters, numbers and underscores and starting the name with a letter or underscore.

Next, we have to specify the data type of the variable. C has several data types, like integers, floats, and characters. We have to choose the appropriate data type for the information we want to store in the variable.

We also have to make sure to initialize the variable, which meant giving it a starting value. If we didn't initialize the variable, it could contain random or undefined data, which could cause problems in the program.

Another rule we have to follow was to declare variables at the beginning of a code block. This helped to organize us code and prevent errors from occurring.

In addition to these rules, we have to remember to use proper syntax when declaring variables and identifiers. This meant using the correct punctuation, such as semicolons and parentheses and following the correct order for declaring variables and specifying their data types.

How to declare variables in C Programming
Identifier Naming rules in C Language
How to comment in C

#subscriber #educationalvideo #coder #cprogrammingquestions #variables
Рекомендации по теме
Комментарии
Автор


Apart from structured learning, you will get:
- Study Material
- Notes
- Practical Codes
- Quizzes & Tests
- Interview Questions
- Real-time Projects
- Videos in Sequential Order
- Video Playlist
- Roadmap to get job
- Job updates
- Industry-recognized Certificate


DataFlairHindi
Автор

Sir
unsigned int a=32767, a2=10, b=a+a2
Iska output(-32759) negative me kyu aa rha hai sir

AmanVerma-bish
Автор

identifiers are names given to various programming elements such as variables, functions

amreshkadam
Автор

Sir your videos are awesome. So much to learn. Would you please add java course if possible??? much much helpful..

salilmainali
Автор

sir you are best teacher.
Sir, unsigned int a=32765; a=a+5; dete hai to output -32766 aata turbo c me.
Sir aisa kyun?

gopalkumar
Автор

\\, \* is used for comments
comment code means compiler is not going to execute this code at the time of compilation

amreshkadam
Автор

rules for declaring identifiers
1 first letter must be alphabet ( because c is a case sensitive language )
2 no space allowed between the variable
3 except underscore_ no special character allowed
4 no keyword allowed

amreshkadam
Автор

can we declare a variable with alphabets and underscore or just alphabets?

afiyakhalid
Автор

Sir i think Aap ki video age pichhe ho gai hai playlist ke according 😢

gyanprakashmishra