SlideShare a Scribd company logo
1 of 22
Intro to Programing
Content ..
Variables, Switch statement,
Conditional statement, Loop and Array;
By: Ghulam Raxa
A memory location whose content may change
during program execution.
The syntax for declaring one variable or multiple
variables is ……..
VARIABLE
dataType identifier, identifier, . . .;
int a, b, ………;
The first statement tells the compiler to allocate memory space to store
decimal or double type value and call it overs.
The second statement tells the compiler to allocate memory space to store
chr (a,….to…z) and call it ch.
The third statement tells the compiler to allocate memory space to store
int type value and call it x and y here we have two identifiers.
The fourth statement tells the compiler to allocate memory space to store
string and call it name.
DIFFERENT MEMORY
ALLOCATIONS
double overs;
char ch;
int x, y;
string name;
How do you put data into those variables?
Use C++’s assignment statement.
In an assignment statement, the value of the expression
should match the data type of
the variable.
In C++, = is called the assignment operator.
PUTTING DATA INTO
VARIABLES
variable = expression;
a = 12;
C++’s switch structure gives the computer the power to choose from among
many alternatives.
A general syntax of the switch statement is:
In C++, switch, case, break, and default are
. reserved words.
SWITCH STATEMENT
EXAMPLE
switch (grade)
{
case 'A':
cout << "The grade point is 4.0.";
break;
case 'B':
cout << "The grade point is 3.0.";
break;
case 'C':
cout << "The grade point is 2.0.";
break;
default:
cout << "The grade is invalid.";
}
SWITCH STATEMENT
After giving value of ch “A” what will happen:
After giving value of ch “R” what will happen:
SWITCH STATEMENT
The two most common Conditional statement are use in selection
and repetition.
CONDITIONAL STATEMENT
OR SELECTION STATEMENT
Selection Repetition
One Way Selection
The syntax of one-way selection is:
CONDITIONAL STATEMENT
CONDITIONAL STATEMENT
OR SELECTION STATEMENT
CONDITIONAL STATEMENT
OR SELECTION STATEMENT
Two Way Selection
Two-way selection uses the following syntax:
CONDITIONAL STATEMENT
OR SELECTION STATEMENT
Code Out put
Set of instructions that repeat themselves until a certain
condition is fulfilled.
We can call these looping statements or loops.
It is also called iteration statement.
There are three types of loop in C++;
for loop
while loop
do while loop
LOOPING
STATEMENTS
A general syntax of the for loop is:
FOR LOOP
for (starting expression; test expression; update expression)
{
}
FOR LOOP
Code Out put
While loop is also called entry control loop.
Because it’s checking condition is before update condition.
WHILE LOOP
WHILE LOOP
Code Out put
DO WHILE LOOP
The general form of a do. . .while statement is as follows:
It runs atleast once! weather test-condition is TRUE or FALSE.
Therefore it’s called exit controlled loop.
DO WHILE LOOP
Let’s check that if the test-condition is FALSE but still the loop will run once.
Code Out put
An array is a collection of variables of the same types that
are referenced by a common name.
Array are a way of grouping together similar item to form a
larger unit.
The general form for declaring a one-dimensional array is:
ARRAYS
If we declare!
int a[10];
ARRAYS
Set of Boxes of same data types
ARRAYS
Code Out put
Thank You
?

More Related Content

What's hot

Btech i pic u-3 handling input output and control statements
Btech i pic u-3 handling input output and control statementsBtech i pic u-3 handling input output and control statements
Btech i pic u-3 handling input output and control statementsRai University
 
Mesics lecture 6 control statement = if -else if__else
Mesics lecture 6   control statement = if -else if__elseMesics lecture 6   control statement = if -else if__else
Mesics lecture 6 control statement = if -else if__elseeShikshak
 
Learn C# Programming - Decision Making & Loops
Learn C# Programming - Decision Making & LoopsLearn C# Programming - Decision Making & Loops
Learn C# Programming - Decision Making & LoopsEng Teong Cheah
 
Mca i pic u-3 handling input output and control statements
Mca i pic u-3 handling input output and control statementsMca i pic u-3 handling input output and control statements
Mca i pic u-3 handling input output and control statementsRai University
 
Diploma ii cfpc u-3 handling input output and control statements
Diploma ii  cfpc u-3 handling input output and control statementsDiploma ii  cfpc u-3 handling input output and control statements
Diploma ii cfpc u-3 handling input output and control statementsRai University
 
C programming decision making
C programming decision makingC programming decision making
C programming decision makingSENA
 
Bsc cs pic u-3 handling input output and control statements
Bsc cs  pic u-3 handling input output and control statementsBsc cs  pic u-3 handling input output and control statements
Bsc cs pic u-3 handling input output and control statementsRai University
 
Decision making and loop in C#
Decision making and loop in C#Decision making and loop in C#
Decision making and loop in C#Prasanna Kumar SM
 
Storage Classes and Functions
Storage Classes and FunctionsStorage Classes and Functions
Storage Classes and FunctionsJake Bond
 
Types of loops in c language
Types of loops in c languageTypes of loops in c language
Types of loops in c languagesneha2494
 
Selection Statements in C Programming
Selection Statements in C ProgrammingSelection Statements in C Programming
Selection Statements in C ProgrammingKamal Acharya
 
Control Structures
Control StructuresControl Structures
Control StructuresGhaffar Khan
 
Storage Class Specifiers in C++
Storage Class Specifiers in C++Storage Class Specifiers in C++
Storage Class Specifiers in C++Reddhi Basu
 
1584503386 1st chap
1584503386 1st chap1584503386 1st chap
1584503386 1st chapthuhiendtk4
 

What's hot (20)

Btech i pic u-3 handling input output and control statements
Btech i pic u-3 handling input output and control statementsBtech i pic u-3 handling input output and control statements
Btech i pic u-3 handling input output and control statements
 
Mesics lecture 6 control statement = if -else if__else
Mesics lecture 6   control statement = if -else if__elseMesics lecture 6   control statement = if -else if__else
Mesics lecture 6 control statement = if -else if__else
 
Learn C# Programming - Decision Making & Loops
Learn C# Programming - Decision Making & LoopsLearn C# Programming - Decision Making & Loops
Learn C# Programming - Decision Making & Loops
 
Mca i pic u-3 handling input output and control statements
Mca i pic u-3 handling input output and control statementsMca i pic u-3 handling input output and control statements
Mca i pic u-3 handling input output and control statements
 
Control statement
Control statementControl statement
Control statement
 
Diploma ii cfpc u-3 handling input output and control statements
Diploma ii  cfpc u-3 handling input output and control statementsDiploma ii  cfpc u-3 handling input output and control statements
Diploma ii cfpc u-3 handling input output and control statements
 
C programming decision making
C programming decision makingC programming decision making
C programming decision making
 
Bsc cs pic u-3 handling input output and control statements
Bsc cs  pic u-3 handling input output and control statementsBsc cs  pic u-3 handling input output and control statements
Bsc cs pic u-3 handling input output and control statements
 
C++ chapter 4
C++ chapter 4C++ chapter 4
C++ chapter 4
 
C++ STATEMENTS
C++ STATEMENTS C++ STATEMENTS
C++ STATEMENTS
 
Decision making and loop in C#
Decision making and loop in C#Decision making and loop in C#
Decision making and loop in C#
 
Storage Classes and Functions
Storage Classes and FunctionsStorage Classes and Functions
Storage Classes and Functions
 
Types of loops in c language
Types of loops in c languageTypes of loops in c language
Types of loops in c language
 
Selection Statements in C Programming
Selection Statements in C ProgrammingSelection Statements in C Programming
Selection Statements in C Programming
 
Control Structures
Control StructuresControl Structures
Control Structures
 
Introduction to C#
Introduction to C#Introduction to C#
Introduction to C#
 
Control statements
Control statementsControl statements
Control statements
 
Storage Class Specifiers in C++
Storage Class Specifiers in C++Storage Class Specifiers in C++
Storage Class Specifiers in C++
 
1584503386 1st chap
1584503386 1st chap1584503386 1st chap
1584503386 1st chap
 
Flow of Control
Flow of ControlFlow of Control
Flow of Control
 

Viewers also liked

Apple Computer
Apple ComputerApple Computer
Apple ComputerEric Moon
 
Conditional Statements
Conditional StatementsConditional Statements
Conditional Statementsmicdsram
 
Conditional statement
Conditional statementConditional statement
Conditional statementMaxie Santos
 
Input, output, storage device
Input, output, storage deviceInput, output, storage device
Input, output, storage deviceNur Azlina
 
Types of computer system error
Types of computer system errorTypes of computer system error
Types of computer system errorRachel Espino
 
Apple inc. (corporate culture)
Apple inc. (corporate culture)Apple inc. (corporate culture)
Apple inc. (corporate culture)Raviraj Jadeja
 
Input, Output and Storage Devices
Input, Output and Storage DevicesInput, Output and Storage Devices
Input, Output and Storage Devicesguest30320a
 
Different Types of Computers
Different Types of ComputersDifferent Types of Computers
Different Types of ComputersDanielAtkinson96
 
Computer Systems - Input, Process, Output
Computer Systems - Input, Process, OutputComputer Systems - Input, Process, Output
Computer Systems - Input, Process, Outputcorb201
 
Apple presentation.ppt
Apple presentation.pptApple presentation.ppt
Apple presentation.pptRakesh Kumar
 
Apple Inc Presentatioin
Apple Inc PresentatioinApple Inc Presentatioin
Apple Inc Presentatioin2AM
 
TYPES OF MEMORIES AND STORAGE DEVICE AND COMPUTER
TYPES OF MEMORIES AND STORAGE DEVICE AND COMPUTER TYPES OF MEMORIES AND STORAGE DEVICE AND COMPUTER
TYPES OF MEMORIES AND STORAGE DEVICE AND COMPUTER Rajat More
 
Dell case study (management)
Dell case study (management)Dell case study (management)
Dell case study (management)Vineeth Kamisetty
 
Strategic Management Presentation - Apple Inc.
Strategic Management Presentation - Apple Inc.Strategic Management Presentation - Apple Inc.
Strategic Management Presentation - Apple Inc.Colby Nelson
 
State of the Word 2011
State of the Word 2011State of the Word 2011
State of the Word 2011photomatt
 

Viewers also liked (19)

Apple Computer
Apple ComputerApple Computer
Apple Computer
 
Conditional Statements
Conditional StatementsConditional Statements
Conditional Statements
 
Conditional statement
Conditional statementConditional statement
Conditional statement
 
Super computer
Super computerSuper computer
Super computer
 
Input, output, storage device
Input, output, storage deviceInput, output, storage device
Input, output, storage device
 
Types of Computer
Types of ComputerTypes of Computer
Types of Computer
 
Types of computer system error
Types of computer system errorTypes of computer system error
Types of computer system error
 
Apple inc. (corporate culture)
Apple inc. (corporate culture)Apple inc. (corporate culture)
Apple inc. (corporate culture)
 
Input, Output and Storage Devices
Input, Output and Storage DevicesInput, Output and Storage Devices
Input, Output and Storage Devices
 
Classification of computers
Classification of computersClassification of computers
Classification of computers
 
Data Processing
Data ProcessingData Processing
Data Processing
 
Different Types of Computers
Different Types of ComputersDifferent Types of Computers
Different Types of Computers
 
Computer Systems - Input, Process, Output
Computer Systems - Input, Process, OutputComputer Systems - Input, Process, Output
Computer Systems - Input, Process, Output
 
Apple presentation.ppt
Apple presentation.pptApple presentation.ppt
Apple presentation.ppt
 
Apple Inc Presentatioin
Apple Inc PresentatioinApple Inc Presentatioin
Apple Inc Presentatioin
 
TYPES OF MEMORIES AND STORAGE DEVICE AND COMPUTER
TYPES OF MEMORIES AND STORAGE DEVICE AND COMPUTER TYPES OF MEMORIES AND STORAGE DEVICE AND COMPUTER
TYPES OF MEMORIES AND STORAGE DEVICE AND COMPUTER
 
Dell case study (management)
Dell case study (management)Dell case study (management)
Dell case study (management)
 
Strategic Management Presentation - Apple Inc.
Strategic Management Presentation - Apple Inc.Strategic Management Presentation - Apple Inc.
Strategic Management Presentation - Apple Inc.
 
State of the Word 2011
State of the Word 2011State of the Word 2011
State of the Word 2011
 

Similar to Programming Fundamentals

C# language basics (Visual Studio)
C# language basics (Visual Studio) C# language basics (Visual Studio)
C# language basics (Visual Studio) rnkhan
 
C# language basics (Visual studio)
C# language basics (Visual studio)C# language basics (Visual studio)
C# language basics (Visual studio)rnkhan
 
C Language (All Concept)
C Language (All Concept)C Language (All Concept)
C Language (All Concept)sachindane
 
[C++][a] tutorial 2
[C++][a] tutorial 2[C++][a] tutorial 2
[C++][a] tutorial 2yasir_cesc
 
plsql tutorialhub....
plsql tutorialhub....plsql tutorialhub....
plsql tutorialhub....Abhiram Vijay
 
Basic Structure Of C++
Basic Structure Of C++Basic Structure Of C++
Basic Structure Of C++DevangiParekh1
 
LOOPING IN C- PROGRAMMING.pptx
LOOPING IN C- PROGRAMMING.pptxLOOPING IN C- PROGRAMMING.pptx
LOOPING IN C- PROGRAMMING.pptxAFANJIPHILL
 
handling input output and control statements
 handling input output and control statements handling input output and control statements
handling input output and control statementsRai University
 

Similar to Programming Fundamentals (20)

C# language basics (Visual Studio)
C# language basics (Visual Studio) C# language basics (Visual Studio)
C# language basics (Visual Studio)
 
C# language basics (Visual studio)
C# language basics (Visual studio)C# language basics (Visual studio)
C# language basics (Visual studio)
 
Java Programming
Java Programming Java Programming
Java Programming
 
C Programming Unit-2
C Programming Unit-2C Programming Unit-2
C Programming Unit-2
 
Programming in Arduino (Part 2)
Programming in Arduino  (Part 2)Programming in Arduino  (Part 2)
Programming in Arduino (Part 2)
 
Programming-in-C
Programming-in-CProgramming-in-C
Programming-in-C
 
qb unit2 solve eem201.pdf
qb unit2 solve eem201.pdfqb unit2 solve eem201.pdf
qb unit2 solve eem201.pdf
 
C Language (All Concept)
C Language (All Concept)C Language (All Concept)
C Language (All Concept)
 
Overloading
OverloadingOverloading
Overloading
 
Programming in C
Programming in CProgramming in C
Programming in C
 
[C++][a] tutorial 2
[C++][a] tutorial 2[C++][a] tutorial 2
[C++][a] tutorial 2
 
PL/SQL Introduction
PL/SQL IntroductionPL/SQL Introduction
PL/SQL Introduction
 
Final requirement
Final requirementFinal requirement
Final requirement
 
plsql tutorialhub....
plsql tutorialhub....plsql tutorialhub....
plsql tutorialhub....
 
Pl sql programme
Pl sql programmePl sql programme
Pl sql programme
 
Basic Structure Of C++
Basic Structure Of C++Basic Structure Of C++
Basic Structure Of C++
 
LOOPING IN C- PROGRAMMING.pptx
LOOPING IN C- PROGRAMMING.pptxLOOPING IN C- PROGRAMMING.pptx
LOOPING IN C- PROGRAMMING.pptx
 
DECISION MAKING.pptx
DECISION MAKING.pptxDECISION MAKING.pptx
DECISION MAKING.pptx
 
handling input output and control statements
 handling input output and control statements handling input output and control statements
handling input output and control statements
 
C programming session3
C programming  session3C programming  session3
C programming session3
 

Recently uploaded

Cheap Rate Call girls Malviya Nagar 9205541914 shot 1500 night
Cheap Rate Call girls Malviya Nagar 9205541914 shot 1500 nightCheap Rate Call girls Malviya Nagar 9205541914 shot 1500 night
Cheap Rate Call girls Malviya Nagar 9205541914 shot 1500 nightDelhi Call girls
 
Kieran Salaria Graphic Design PDF Portfolio
Kieran Salaria Graphic Design PDF PortfolioKieran Salaria Graphic Design PDF Portfolio
Kieran Salaria Graphic Design PDF Portfolioktksalaria
 
The_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdf
The_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdfThe_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdf
The_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdfAmirYakdi
 
Fashion trends before and after covid.pptx
Fashion trends before and after covid.pptxFashion trends before and after covid.pptx
Fashion trends before and after covid.pptxVanshNarang19
 
3D Printing And Designing Final Report.pdf
3D Printing And Designing Final Report.pdf3D Printing And Designing Final Report.pdf
3D Printing And Designing Final Report.pdfSwaraliBorhade
 
NO1 Famous Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi Add...
NO1 Famous Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi Add...NO1 Famous Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi Add...
NO1 Famous Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi Add...Amil baba
 
Cheap Rate ➥8448380779 ▻Call Girls In Iffco Chowk Gurgaon
Cheap Rate ➥8448380779 ▻Call Girls In Iffco Chowk GurgaonCheap Rate ➥8448380779 ▻Call Girls In Iffco Chowk Gurgaon
Cheap Rate ➥8448380779 ▻Call Girls In Iffco Chowk GurgaonDelhi Call girls
 
How to Be Famous in your Field just visit our Site
How to Be Famous in your Field just visit our SiteHow to Be Famous in your Field just visit our Site
How to Be Famous in your Field just visit our Sitegalleryaagency
 
Call Girls in Okhla Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Okhla Delhi 💯Call Us 🔝8264348440🔝Call Girls in Okhla Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Okhla Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
NATA 2024 SYLLABUS, full syllabus explained in detail
NATA 2024 SYLLABUS, full syllabus explained in detailNATA 2024 SYLLABUS, full syllabus explained in detail
NATA 2024 SYLLABUS, full syllabus explained in detailDesigntroIntroducing
 
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130Suhani Kapoor
 
shot list for my tv series two steps back
shot list for my tv series two steps backshot list for my tv series two steps back
shot list for my tv series two steps back17lcow074
 
Cheap Rate Call girls Kalkaji 9205541914 shot 1500 night
Cheap Rate Call girls Kalkaji 9205541914 shot 1500 nightCheap Rate Call girls Kalkaji 9205541914 shot 1500 night
Cheap Rate Call girls Kalkaji 9205541914 shot 1500 nightDelhi Call girls
 
WAEC Carpentry and Joinery Past Questions
WAEC Carpentry and Joinery Past QuestionsWAEC Carpentry and Joinery Past Questions
WAEC Carpentry and Joinery Past QuestionsCharles Obaleagbon
 
Call Girls In Safdarjung Enclave 24/7✡️9711147426✡️ Escorts Service
Call Girls In Safdarjung Enclave 24/7✡️9711147426✡️ Escorts ServiceCall Girls In Safdarjung Enclave 24/7✡️9711147426✡️ Escorts Service
Call Girls In Safdarjung Enclave 24/7✡️9711147426✡️ Escorts Servicejennyeacort
 
Kala jadu for love marriage | Real amil baba | Famous amil baba | kala jadu n...
Kala jadu for love marriage | Real amil baba | Famous amil baba | kala jadu n...Kala jadu for love marriage | Real amil baba | Famous amil baba | kala jadu n...
Kala jadu for love marriage | Real amil baba | Famous amil baba | kala jadu n...babafaisel
 
PORTAFOLIO 2024_ ANASTASIYA KUDINOVA
PORTAFOLIO   2024_  ANASTASIYA  KUDINOVAPORTAFOLIO   2024_  ANASTASIYA  KUDINOVA
PORTAFOLIO 2024_ ANASTASIYA KUDINOVAAnastasiya Kudinova
 
SD_The MATATAG Curriculum Training Design.pptx
SD_The MATATAG Curriculum Training Design.pptxSD_The MATATAG Curriculum Training Design.pptx
SD_The MATATAG Curriculum Training Design.pptxjanettecruzeiro1
 
Kindergarten Assessment Questions Via LessonUp
Kindergarten Assessment Questions Via LessonUpKindergarten Assessment Questions Via LessonUp
Kindergarten Assessment Questions Via LessonUpmainac1
 

Recently uploaded (20)

Cheap Rate Call girls Malviya Nagar 9205541914 shot 1500 night
Cheap Rate Call girls Malviya Nagar 9205541914 shot 1500 nightCheap Rate Call girls Malviya Nagar 9205541914 shot 1500 night
Cheap Rate Call girls Malviya Nagar 9205541914 shot 1500 night
 
Kieran Salaria Graphic Design PDF Portfolio
Kieran Salaria Graphic Design PDF PortfolioKieran Salaria Graphic Design PDF Portfolio
Kieran Salaria Graphic Design PDF Portfolio
 
The_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdf
The_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdfThe_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdf
The_Canvas_of_Creative_Mastery_Newsletter_April_2024_Version.pdf
 
Fashion trends before and after covid.pptx
Fashion trends before and after covid.pptxFashion trends before and after covid.pptx
Fashion trends before and after covid.pptx
 
3D Printing And Designing Final Report.pdf
3D Printing And Designing Final Report.pdf3D Printing And Designing Final Report.pdf
3D Printing And Designing Final Report.pdf
 
NO1 Famous Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi Add...
NO1 Famous Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi Add...NO1 Famous Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi Add...
NO1 Famous Amil Baba In Karachi Kala Jadu In Karachi Amil baba In Karachi Add...
 
Cheap Rate ➥8448380779 ▻Call Girls In Iffco Chowk Gurgaon
Cheap Rate ➥8448380779 ▻Call Girls In Iffco Chowk GurgaonCheap Rate ➥8448380779 ▻Call Girls In Iffco Chowk Gurgaon
Cheap Rate ➥8448380779 ▻Call Girls In Iffco Chowk Gurgaon
 
How to Be Famous in your Field just visit our Site
How to Be Famous in your Field just visit our SiteHow to Be Famous in your Field just visit our Site
How to Be Famous in your Field just visit our Site
 
young call girls in Vivek Vihar🔝 9953056974 🔝 Delhi escort Service
young call girls in Vivek Vihar🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Vivek Vihar🔝 9953056974 🔝 Delhi escort Service
young call girls in Vivek Vihar🔝 9953056974 🔝 Delhi escort Service
 
Call Girls in Okhla Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Okhla Delhi 💯Call Us 🔝8264348440🔝Call Girls in Okhla Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Okhla Delhi 💯Call Us 🔝8264348440🔝
 
NATA 2024 SYLLABUS, full syllabus explained in detail
NATA 2024 SYLLABUS, full syllabus explained in detailNATA 2024 SYLLABUS, full syllabus explained in detail
NATA 2024 SYLLABUS, full syllabus explained in detail
 
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
 
shot list for my tv series two steps back
shot list for my tv series two steps backshot list for my tv series two steps back
shot list for my tv series two steps back
 
Cheap Rate Call girls Kalkaji 9205541914 shot 1500 night
Cheap Rate Call girls Kalkaji 9205541914 shot 1500 nightCheap Rate Call girls Kalkaji 9205541914 shot 1500 night
Cheap Rate Call girls Kalkaji 9205541914 shot 1500 night
 
WAEC Carpentry and Joinery Past Questions
WAEC Carpentry and Joinery Past QuestionsWAEC Carpentry and Joinery Past Questions
WAEC Carpentry and Joinery Past Questions
 
Call Girls In Safdarjung Enclave 24/7✡️9711147426✡️ Escorts Service
Call Girls In Safdarjung Enclave 24/7✡️9711147426✡️ Escorts ServiceCall Girls In Safdarjung Enclave 24/7✡️9711147426✡️ Escorts Service
Call Girls In Safdarjung Enclave 24/7✡️9711147426✡️ Escorts Service
 
Kala jadu for love marriage | Real amil baba | Famous amil baba | kala jadu n...
Kala jadu for love marriage | Real amil baba | Famous amil baba | kala jadu n...Kala jadu for love marriage | Real amil baba | Famous amil baba | kala jadu n...
Kala jadu for love marriage | Real amil baba | Famous amil baba | kala jadu n...
 
PORTAFOLIO 2024_ ANASTASIYA KUDINOVA
PORTAFOLIO   2024_  ANASTASIYA  KUDINOVAPORTAFOLIO   2024_  ANASTASIYA  KUDINOVA
PORTAFOLIO 2024_ ANASTASIYA KUDINOVA
 
SD_The MATATAG Curriculum Training Design.pptx
SD_The MATATAG Curriculum Training Design.pptxSD_The MATATAG Curriculum Training Design.pptx
SD_The MATATAG Curriculum Training Design.pptx
 
Kindergarten Assessment Questions Via LessonUp
Kindergarten Assessment Questions Via LessonUpKindergarten Assessment Questions Via LessonUp
Kindergarten Assessment Questions Via LessonUp
 

Programming Fundamentals

  • 1. Intro to Programing Content .. Variables, Switch statement, Conditional statement, Loop and Array; By: Ghulam Raxa
  • 2. A memory location whose content may change during program execution. The syntax for declaring one variable or multiple variables is …….. VARIABLE dataType identifier, identifier, . . .; int a, b, ………;
  • 3. The first statement tells the compiler to allocate memory space to store decimal or double type value and call it overs. The second statement tells the compiler to allocate memory space to store chr (a,….to…z) and call it ch. The third statement tells the compiler to allocate memory space to store int type value and call it x and y here we have two identifiers. The fourth statement tells the compiler to allocate memory space to store string and call it name. DIFFERENT MEMORY ALLOCATIONS double overs; char ch; int x, y; string name;
  • 4. How do you put data into those variables? Use C++’s assignment statement. In an assignment statement, the value of the expression should match the data type of the variable. In C++, = is called the assignment operator. PUTTING DATA INTO VARIABLES variable = expression; a = 12;
  • 5. C++’s switch structure gives the computer the power to choose from among many alternatives. A general syntax of the switch statement is: In C++, switch, case, break, and default are . reserved words. SWITCH STATEMENT
  • 6. EXAMPLE switch (grade) { case 'A': cout << "The grade point is 4.0."; break; case 'B': cout << "The grade point is 3.0."; break; case 'C': cout << "The grade point is 2.0."; break; default: cout << "The grade is invalid."; } SWITCH STATEMENT
  • 7. After giving value of ch “A” what will happen: After giving value of ch “R” what will happen: SWITCH STATEMENT
  • 8. The two most common Conditional statement are use in selection and repetition. CONDITIONAL STATEMENT OR SELECTION STATEMENT Selection Repetition
  • 9. One Way Selection The syntax of one-way selection is: CONDITIONAL STATEMENT CONDITIONAL STATEMENT OR SELECTION STATEMENT
  • 10. CONDITIONAL STATEMENT OR SELECTION STATEMENT Two Way Selection Two-way selection uses the following syntax:
  • 11. CONDITIONAL STATEMENT OR SELECTION STATEMENT Code Out put
  • 12. Set of instructions that repeat themselves until a certain condition is fulfilled. We can call these looping statements or loops. It is also called iteration statement. There are three types of loop in C++; for loop while loop do while loop LOOPING STATEMENTS
  • 13. A general syntax of the for loop is: FOR LOOP for (starting expression; test expression; update expression) { }
  • 15. While loop is also called entry control loop. Because it’s checking condition is before update condition. WHILE LOOP
  • 17. DO WHILE LOOP The general form of a do. . .while statement is as follows: It runs atleast once! weather test-condition is TRUE or FALSE. Therefore it’s called exit controlled loop.
  • 18. DO WHILE LOOP Let’s check that if the test-condition is FALSE but still the loop will run once. Code Out put
  • 19. An array is a collection of variables of the same types that are referenced by a common name. Array are a way of grouping together similar item to form a larger unit. The general form for declaring a one-dimensional array is: ARRAYS
  • 20. If we declare! int a[10]; ARRAYS Set of Boxes of same data types