SlideShare ist ein Scribd-Unternehmen logo
1 von 57
Introduction to Programming Lab No. 2 [email_address] Air University
[object Object],[object Object],Memory x 6 Air University
Memory ,[object Object],a b x Air University
How To get Value from User ,[object Object],[object Object],Air University
QUIZ # 1 Calculate Average Age of  10 Students ,[object Object],[object Object],[object Object],[object Object],[object Object],Air University
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Air University
Interesting Problem ,[object Object],Air University
Analysis ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Air University
Code ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Air University
Flow Chart for if statement Condition Process IF Then Entry point for IF block Exit point for IF block Air University
if  Statement ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Practice Example # 1 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Air University
Relational Operators  ,[object Object],[object Object],[object Object],[object Object],Air University
Relational Operators  Air University
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Air University
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Practice Example # 2
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Air University Practice Example # 3
if-else ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
if-else Condition Process 1 IF Then Entry point for IF-Else block Exit point for IF block Process 2 Else Note indentation from left to right
Practice Example # 4 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Air University
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Practice Example # 5
Example Nested if ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Largest Number among 3 ,[object Object],[object Object],[object Object],[object Object],[object Object],Air University
Largest Number among 3  (Code) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Air University
Largest Number among 3  (Code) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Air University
Largest Number among 3  (Out Put) ,[object Object],[object Object],[object Object],[object Object],[object Object],Air University
Nested if else ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Air University
Nested if else (Code) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Air University
Nested if else (Code) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Air University
Nested if - else ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Nested  if-elses  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Air University
Nested  if-elses  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Air University
Forms of  if  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Air University
[object Object],[object Object],[object Object],[object Object],Forms of  if  Air University
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Forms of  if  Air University
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Forms of  if  Air University
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Forms of  if  Air University
Logical Operators ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Logical Operators ,[object Object],[object Object],In C++ if(a > b && c> d) if(age > 18 || height > 5)
Example ,[object Object],[object Object],[object Object],[object Object]
Vowel / Consonant ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Air University
Vowel / Consonant (Code) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Air University
Odd/ Even ,[object Object],[object Object],[object Object],[object Object],Air University
Odd/ Even (Code) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Air University
Small / Capital Letter ,[object Object],[object Object],[object Object],[object Object],[object Object],Air University
Small / Capital Letter (Code) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Air University
Small / Capital Letter (Code) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Air University
The Conditional Operators  ,[object Object],[object Object],[object Object],Air University
Example of Condition Operator ,[object Object],[object Object],[object Object],[object Object],Air University
Condition Operator (?:) ,[object Object],[object Object],[object Object],[object Object],[object Object],Air University
Condition Operator (?:) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Air University
Temperature Program ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Air University
Temperature Program ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Air University
Temperature Program ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Air University
Hierarchy of Operators  Air University
Assignment [10 Marks] ,[object Object],Air University
[object Object],[object Object],[object Object],Air University

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

4. programing 101
4. programing 1014. programing 101
4. programing 101
 
C decision making and looping.
C decision making and looping.C decision making and looping.
C decision making and looping.
 
C++ programming
C++ programmingC++ programming
C++ programming
 
C++ programming
C++ programmingC++ programming
C++ programming
 
9 character string & string library
9  character string & string library9  character string & string library
9 character string & string library
 
Programming C Part 03
Programming C Part 03Programming C Part 03
Programming C Part 03
 
C++ Programming Club-Lecture 1
C++ Programming Club-Lecture 1C++ Programming Club-Lecture 1
C++ Programming Club-Lecture 1
 
UNIT-II CP DOC.docx
UNIT-II CP DOC.docxUNIT-II CP DOC.docx
UNIT-II CP DOC.docx
 
Programming fundamental 02
Programming fundamental 02Programming fundamental 02
Programming fundamental 02
 
Loops and conditional statements
Loops and conditional statementsLoops and conditional statements
Loops and conditional statements
 
Analyzing the Dolphin-emu project
Analyzing the Dolphin-emu projectAnalyzing the Dolphin-emu project
Analyzing the Dolphin-emu project
 
C Programming Unit-2
C Programming Unit-2C Programming Unit-2
C Programming Unit-2
 
Handling Exceptions In C & C++ [Part B] Ver 2
Handling Exceptions In C & C++ [Part B] Ver 2Handling Exceptions In C & C++ [Part B] Ver 2
Handling Exceptions In C & C++ [Part B] Ver 2
 
Csphtp1 15
Csphtp1 15Csphtp1 15
Csphtp1 15
 
Decision statements in c language
Decision statements in c languageDecision statements in c language
Decision statements in c language
 
2 data and c
2 data and c2 data and c
2 data and c
 
Lecture 10 - Control Structures 2
Lecture 10 - Control Structures 2Lecture 10 - Control Structures 2
Lecture 10 - Control Structures 2
 
1 introducing c language
1  introducing c language1  introducing c language
1 introducing c language
 
L05if
L05ifL05if
L05if
 
Control structuresin c
Control structuresin cControl structuresin c
Control structuresin c
 

Andere mochten auch

C++ programming flowchart. home work t.hemn
C++ programming flowchart. home work t.hemnC++ programming flowchart. home work t.hemn
C++ programming flowchart. home work t.hemn
Aram SE
 
Artificial Intelligence Presentation
Artificial Intelligence PresentationArtificial Intelligence Presentation
Artificial Intelligence Presentation
lpaviglianiti
 
Kinh te tri thuc 1
Kinh te tri thuc 1Kinh te tri thuc 1
Kinh te tri thuc 1
Sơn Tiến
 
Powerpoint til halvårspresentasjon!
Powerpoint til halvårspresentasjon!Powerpoint til halvårspresentasjon!
Powerpoint til halvårspresentasjon!
mariaoswahn
 
สอนแต่งภาพ
สอนแต่งภาพสอนแต่งภาพ
สอนแต่งภาพ
Gufgif Sweetzii
 
Billboard analysis
Billboard analysisBillboard analysis
Billboard analysis
Tyrrell
 
Photography and Planning for poster
Photography and Planning for posterPhotography and Planning for poster
Photography and Planning for poster
tiffanybreen1
 
Antivirusbok eva eileen margit
Antivirusbok eva eileen margitAntivirusbok eva eileen margit
Antivirusbok eva eileen margit
margitsy
 
Envision charlotte information session
Envision charlotte information sessionEnvision charlotte information session
Envision charlotte information session
cpfeiler
 
Target audience analyse
Target audience analyseTarget audience analyse
Target audience analyse
nctcmedia12
 

Andere mochten auch (20)

Lab # 1
Lab # 1Lab # 1
Lab # 1
 
Lab manual of C++
Lab manual of C++Lab manual of C++
Lab manual of C++
 
C++ programming flowchart. home work t.hemn
C++ programming flowchart. home work t.hemnC++ programming flowchart. home work t.hemn
C++ programming flowchart. home work t.hemn
 
Artificial Intelligence Presentation
Artificial Intelligence PresentationArtificial Intelligence Presentation
Artificial Intelligence Presentation
 
Kinh te tri thuc 1
Kinh te tri thuc 1Kinh te tri thuc 1
Kinh te tri thuc 1
 
Hashing and you
Hashing and youHashing and you
Hashing and you
 
Powerpoint til halvårspresentasjon!
Powerpoint til halvårspresentasjon!Powerpoint til halvårspresentasjon!
Powerpoint til halvårspresentasjon!
 
Dlf Ltd
Dlf LtdDlf Ltd
Dlf Ltd
 
สอนแต่งภาพ
สอนแต่งภาพสอนแต่งภาพ
สอนแต่งภาพ
 
Soalan s po t psk 3103
Soalan s po t psk 3103Soalan s po t psk 3103
Soalan s po t psk 3103
 
Тульчинский Г.Л. Региональное измерение PR как public relations и public resp...
Тульчинский Г.Л. Региональное измерение PR как public relations и public resp...Тульчинский Г.Л. Региональное измерение PR как public relations и public resp...
Тульчинский Г.Л. Региональное измерение PR как public relations и public resp...
 
Billboard analysis
Billboard analysisBillboard analysis
Billboard analysis
 
Photography and Planning for poster
Photography and Planning for posterPhotography and Planning for poster
Photography and Planning for poster
 
Antivirusbok eva eileen margit
Antivirusbok eva eileen margitAntivirusbok eva eileen margit
Antivirusbok eva eileen margit
 
Коммуникации органов власти Алтайского края с населением (монография)
Коммуникации органов власти Алтайского края с населением (монография)Коммуникации органов власти Алтайского края с населением (монография)
Коммуникации органов власти Алтайского края с населением (монография)
 
Envision charlotte information session
Envision charlotte information sessionEnvision charlotte information session
Envision charlotte information session
 
42827173 500-dinamicas-de-integracion-grupal
42827173 500-dinamicas-de-integracion-grupal42827173 500-dinamicas-de-integracion-grupal
42827173 500-dinamicas-de-integracion-grupal
 
Target audience analyse
Target audience analyseTarget audience analyse
Target audience analyse
 
الفيروسات
الفيروساتالفيروسات
الفيروسات
 
BIOTECHNOLOGI PERTANIAN/BISNIS
BIOTECHNOLOGI PERTANIAN/BISNISBIOTECHNOLOGI PERTANIAN/BISNIS
BIOTECHNOLOGI PERTANIAN/BISNIS
 

Ähnlich wie Lab # 2

Cplusplus
CplusplusCplusplus
Cplusplus
dancey
 
#OOP_D_ITS - 3rd - Migration From C To C++
#OOP_D_ITS - 3rd - Migration From C To C++#OOP_D_ITS - 3rd - Migration From C To C++
#OOP_D_ITS - 3rd - Migration From C To C++
Hadziq Fabroyir
 
Bti1022 lab sheet 8
Bti1022 lab sheet 8Bti1022 lab sheet 8
Bti1022 lab sheet 8
alish sha
 
Bti1022 lab sheet 8
Bti1022 lab sheet 8Bti1022 lab sheet 8
Bti1022 lab sheet 8
alish sha
 
Dti2143 chap 4 control statement part 2
Dti2143 chap 4 control statement part 2Dti2143 chap 4 control statement part 2
Dti2143 chap 4 control statement part 2
alish sha
 
Testing lecture after lec 4
Testing lecture after lec 4Testing lecture after lec 4
Testing lecture after lec 4
emailharmeet
 
Falcon初印象
Falcon初印象Falcon初印象
Falcon初印象
勇浩 赖
 
Php Calling Operators
Php Calling OperatorsPhp Calling Operators
Php Calling Operators
mussawir20
 
Dti2143 lab sheet 8
Dti2143 lab sheet 8Dti2143 lab sheet 8
Dti2143 lab sheet 8
alish sha
 

Ähnlich wie Lab # 2 (20)

Cplusplus
CplusplusCplusplus
Cplusplus
 
#OOP_D_ITS - 3rd - Migration From C To C++
#OOP_D_ITS - 3rd - Migration From C To C++#OOP_D_ITS - 3rd - Migration From C To C++
#OOP_D_ITS - 3rd - Migration From C To C++
 
Prefix Postfix
Prefix PostfixPrefix Postfix
Prefix Postfix
 
Lecture 3
Lecture 3Lecture 3
Lecture 3
 
Bti1022 lab sheet 8
Bti1022 lab sheet 8Bti1022 lab sheet 8
Bti1022 lab sheet 8
 
Bti1022 lab sheet 8
Bti1022 lab sheet 8Bti1022 lab sheet 8
Bti1022 lab sheet 8
 
Dti2143 chap 4 control statement part 2
Dti2143 chap 4 control statement part 2Dti2143 chap 4 control statement part 2
Dti2143 chap 4 control statement part 2
 
Testing lecture after lec 4
Testing lecture after lec 4Testing lecture after lec 4
Testing lecture after lec 4
 
LAB_MANUAL_cpl_21scheme-2.pdf
LAB_MANUAL_cpl_21scheme-2.pdfLAB_MANUAL_cpl_21scheme-2.pdf
LAB_MANUAL_cpl_21scheme-2.pdf
 
Falcon初印象
Falcon初印象Falcon初印象
Falcon初印象
 
Php Calling Operators
Php Calling OperatorsPhp Calling Operators
Php Calling Operators
 
C++ in 10 Hours.pdf.pdf
C++ in 10 Hours.pdf.pdfC++ in 10 Hours.pdf.pdf
C++ in 10 Hours.pdf.pdf
 
Statement
StatementStatement
Statement
 
Lecture 3 c++
Lecture 3 c++Lecture 3 c++
Lecture 3 c++
 
Lecture4
Lecture4Lecture4
Lecture4
 
Csphtp1 05
Csphtp1 05Csphtp1 05
Csphtp1 05
 
Practical Class 12th (c++programs+sql queries and output)
Practical Class 12th (c++programs+sql queries and output) Practical Class 12th (c++programs+sql queries and output)
Practical Class 12th (c++programs+sql queries and output)
 
Practical Class 12th (c++programs+sql queries and output)
Practical Class 12th (c++programs+sql queries and output)Practical Class 12th (c++programs+sql queries and output)
Practical Class 12th (c++programs+sql queries and output)
 
Dti2143 lab sheet 8
Dti2143 lab sheet 8Dti2143 lab sheet 8
Dti2143 lab sheet 8
 
4 operators, expressions & statements
4  operators, expressions & statements4  operators, expressions & statements
4 operators, expressions & statements
 

Kürzlich hochgeladen

Kürzlich hochgeladen (20)

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 

Lab # 2

  • 1. Introduction to Programming Lab No. 2 [email_address] Air University
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10. Flow Chart for if statement Condition Process IF Then Entry point for IF block Exit point for IF block Air University
  • 11.
  • 12.
  • 13.
  • 14. Relational Operators Air University
  • 15.
  • 16.
  • 17.
  • 18.
  • 19. if-else Condition Process 1 IF Then Entry point for IF-Else block Exit point for IF block Process 2 Else Note indentation from left to right
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55. Hierarchy of Operators Air University
  • 56.
  • 57.

Hinweis der Redaktion

  1. Connectors will come at the end
  2. Connectors at the end