Variable Declaration and Initialization in C Programming | Activity 1.8 | 10th Computer Chapter 1

preview_player
Показать описание
3.5 Variable Declaration
We need to declare a variable before we can use it in the program. Declaring a variable includes specifying its data type and giving it a valid name. Following syntax can be followed to declare a variable.
datatype variable_name;

Some examples of valid variable declarations are as follows:

unsigned int age;
float height;
int salary;
char marital_status;

Multiple variables of same data type may also be declared in a single statement, as shown in the following examples:

unsigned int age, basic_salary, gross_salary;
int points_scored, steps;
float height, marks;
char marital_status, gender;

A variable cannot be declared unless we mention its data type. After declaring a variable, its data type cannot be changed. Declaring a variable specifies the type of variable, the range of values allowed by that variable, and the kind of operations that can be performed on it.

1.3.6 Variable Initialization
Assigning value to a variable for the first time is called variable initialization. C language allows us to initialize a variable both at the time of declaration, and after declaring it. For initializing a variable at the time of declaration, we use the following general structure.

data_type variable_hame = value;

Timestamp
00:00 Intro
00:47 Variable Declaration
02:03 Syntax
02:21 Examples of Variable Declaration
03:14 Multiple Variable of Same Data Type
04:20 Example Code 1.2
04:59 Variable Initialization
06:24 Syntax
06:48 Example Code 1.3
07:59 Activity 1.8
10:12 Outro

Social Media Links:
______/❤ All Students are requested to Follow Me on Social Media!! ❤\________

10th Class Computer Science:
How to install and Download Code::Blocks:
10th Computer Science All Lectures Playlist:
10th Computer Science All Exercise Playlist:
10th Computer Science All Example Code Playlist:
10th Computer Science All Programming Time:
10th Computer Science All Activities Playlist:
10th Computer Science All Programming Exercise Playlist:

9th Class Computer Science:
9th Computer Science Chapter 1:
9th Computer Science Chapter 2:
9th Computer Science Chapter 3:
9th Computer Science Chapter 4:
9th Computer Science Chapter 5:
9th Computer Science All Exercise:
9th Computer Science All Activates:
9th Computer Science Complete Lectures:

#VariableDeclarationAndInitializationInCLanguage
#VariablesInCProgramming
#VariablesInCLanguage
#VariableInC
#VariableDeclarationAndDefinitionInC
#VariableDeclarationVsInitialization
#DeclarationVsDefinitionOfAVariableInC
#DeclarationVsInitialization
#DeclarationAndInitializationOfVariable
#ConstantsInCLanguage
#TypesOfConstantsInCProgramming
#ConstantsInC
#WhatAreTheTypesOfConstantsInC
#WhatAreConstantsExplainWithExamples
#ConstantsVariablesAndDataTypes
#InC
#ConstantsAndVariables
#ConstKeywordInC
#ExampleOfConstantsInC
#UsingConstKeywordMakeAProgramInC
#DigitalEducation
#DigitalEducationShahbazAli
#IntroductiontoProgramming
#LearnPythontheHardWay
#PythonCrashCourse
#IntroductiontoPython
#IntroductiontoJava
#IntroductiontoC
#IntroductiontoC
#ComputerGraphicsCourse
#IntroductiontoProgrammingLanguage
#IntroductiontoWebDevelopment
#CProgrammingCourse
#IntroductiontoCProgramming
#10thComputerChapter1
#10thComputerChapter2
#10thComputerChapter3
#10thComputerChapter4
#10thComputerChapter5
#10thComputer
#10thComputerChapter1Exercise
#10thComputerChapter2Exercise
#10thComputerChapter3Exercise
#10thComputerChapter4Exercise
#10thComputerChapter5Exercise
#10thComputerScience
#10thComputerPaper2022
#10thComputerPairingScheme2022
#10thComputerPaper2023
#10thComputerPairingScheme2023
#CLanguageTutorialforBeginners
#CLanguage
#CLanguageFullCourse
#CLanguageProgramming
#CLanguageCodewithHarry
#CLanguageFullCourseinHindi
#CLanguageBasics
#CLanguageTutorial
#CLanguageCourse
#CLanguageTutorialforBeginnersinHindi
#CLanguageinHindi
#CLanguageSaurabhShukla
#CLanguageProject
#CLanguagewithHarry

Computer Science 10th class
Lecturer of Computer Science
By Sir Shahbaz Ali
For any query or private tutoring contact (0309-0334424)
Рекомендации по теме
join shbcf.ru