Variable Initialization in C | Basic Concepts of C Programming | Lec 12 | C Programming

Опубликовано: 10 Октябрь 2021
на канале: CSE Guru
275
5

C is the first and foremost programming language to programming. C is a high level structured programming language developed by Dennis M Ritchie in the year 1972.

This video explains Variable Initialization in C programming.
What is a Variable Initialization?
Declared variables should be initialized inorder to use in programs
Initialization is assigning a value to the variable using assignment operator
Initialization Methods
1. Initializing one variable
Syntax:
data_type var_name = value;
Example
int a=10;

2. Initializing multiple variables
Syntax:
data_type var_name1= value, var_name2= value…. ;
OR
data_type var_name1 = value;
data_type var_name2 = value;
Example
int a=10, b=20;
OR
int a=10;
int b=20;
3. Initializing at appropriate place
Always better to initialize the variable at appropriate place
Syntax:
data_type var_name1;
data_type var_name2;
………
………
var_name1 = 10
var_name2 = 15;
Example
int a;
float b;
........
..........
a=10;
b=20.0;



#variables
#variablesinc
#variableinitialization
#howtoinitializevariable
#clanguage
#variabledeclarationandinitialization
#variable
#cseguruvideos
#csegurucvideos
#cseguruprogrammingvideos
#fundamentalsofc



CSEGuru Videos
#CSEGuru Compiler Design Videos:
   • Compiler Design  

CSEGuru DAA Videos
   • Design & Analysis of Algorithm  

CSEGuru Operating System Videos
   • Operating System  

CSEGuru Gate cse Videos
   • Gate cse  

CSEGuru NET cse Videos
   • NET cse  

CSEGuru Data Structure Videos
   • Data Structure  

CSEGuru Sorting Algorithm Videos
   • Sorting Algorithm