Lecture 1

Mohammed Saleh
Mohammed SalehLecturer um The Institute of Finance Management
[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],[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]
[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]
[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],[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],[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],[object Object],[object Object]
[object Object]
1. Comments 2. Load  <iostream> 3.  main 3.1 Print  &quot;Welcome to C++&quot; 3.2 exit ( return 0 ) Program Output Hello World ! 1 // firstcpp.cpp 2 // A first program in C++ 3 #include  <iostream> 4 5 int  main() 6 { 7   cout << ”Hello World!&quot;; 8 9   return  0;  // indicate that program ended successfully 10 } preprocessor directive   Message to the C++ preprocessor. Lines beginning with  #  are  preprocessor  directives. #include <iostream>  tells the preprocessor to include the contents of the file  <iostream> , which includes input/output operations (such as printing to the screen). Comments Written between  /*  and  */  or following a  // . Improve program readability and do not cause the computer to perform any action. C++ programs contain one or more functions, one of which must be  main Parenthesis are used to indicate a function int  means that  main  &quot;returns&quot; an integer value.  A left brace  {   begins the body of every function and a right brace  }  ends it. Prints the  string  of characters contained between the quotation marks.  The entire line, including  std::cout , the  <<   operator ,  the  string   ”Hello World !&quot;  and the  semicolon  ( ; ), is called a  statement . All statements must end with a semicolon. return  is a way to exit a function from a function. return 0 , in this case, means that the program terminated normally.
[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]
1. Load  <iostream> 2.  main 2.1 Print  &quot;Welcome&quot; 2.2 Print  &quot;to C++!&quot; 2.3 newline 2.4 exit ( return 0 ) Program Output Hello World !   1 // firstcpp.cpp 2 // Printing a line with multiple statements 3 #include  <iostream> 4 5 int  main() 6 { 7   std::cout << ”Hello &quot;; 8   std::cout << ”World !&quot;; 9 10   return  0;  // indicate that program ended successfully 11 } Unless new line  ''  is specified, the text continues on the same line.
1. Load  <iostream> 2.  main 2.1 Print  &quot;Welcome&quot; 2.2 newline 2.3 Print  &quot;to&quot; 2.4 newline 2.5 newline 2.6 Print  &quot;C++!&quot; 2.7 newline 2.8 exit ( return 0 ) Program Output Hello   World !  1 // firstcpp.cpp 2 // Printing multiple lines with a single statement 3 #include  <iostream> 4 5 int  main() 6 { 7   std::cout << ”Hello World !&quot;; 8 9   return  0;  // indicate that program ended successfully 10 } Multiple lines can be printed with one statement.
[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],[object Object],[object Object],[object Object],[object Object],[object Object],Enter first integer 45 Enter second integer 72 Sum is 117 1 // Add.cpp 2 // Addition program 3 #include  <iostream> 4 5 int  main() 6 { 7   int  integer1, integer2, sum;  // declaration 8 9   cout << &quot;Enter first integer&quot;;  // prompt 10   cin >> integer1;  // read an integer 11   cout << &quot;Enter second integer&quot;;  // prompt 12   cin >> integer2;  // read an integer 13   sum = integer1 + integer2;  // assignment of sum 14   cout << &quot;Sum is &quot; << sum << endl;  // print sum 15 16   return  0;  // indicate that program ended successfully 17 } Notice how  cin  is used to get user input. Variables can be output using  cout << variableName . endl  flushes the buffer and prints a newline.
[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]
1 von 44

Recomendados

First fare 2013 basic-labview von
First fare 2013   basic-labviewFirst fare 2013   basic-labview
First fare 2013 basic-labviewOregon FIRST Robotics
1K views32 Folien
Lecture 2 von
Lecture 2Lecture 2
Lecture 2Mohammed Saleh
499 views50 Folien
Cis 1403 lab5_loops von
Cis 1403 lab5_loopsCis 1403 lab5_loops
Cis 1403 lab5_loopsHamad Odhabi
149 views13 Folien
Cis 1403 lab1- the process of programming von
Cis 1403 lab1- the process of programmingCis 1403 lab1- the process of programming
Cis 1403 lab1- the process of programmingHamad Odhabi
112 views20 Folien
C++ programming language basic to advance level von
C++ programming language basic to advance levelC++ programming language basic to advance level
C++ programming language basic to advance levelsajjad ali khan
83 views107 Folien
Error handling and debugging in vb von
Error handling and debugging in vbError handling and debugging in vb
Error handling and debugging in vbSalim M
17.3K views18 Folien

Más contenido relacionado

Was ist angesagt?

Solutions manual for absolute java 5th edition by walter savitch von
Solutions manual for absolute java 5th edition by walter savitchSolutions manual for absolute java 5th edition by walter savitch
Solutions manual for absolute java 5th edition by walter savitchAlbern9271
2K views19 Folien
Ch1 principles of software development von
Ch1 principles of software developmentCh1 principles of software development
Ch1 principles of software developmentHattori Sidek
2K views35 Folien
C++ lab assignment von
C++ lab assignmentC++ lab assignment
C++ lab assignmentSaket Pathak
2K views38 Folien
Switch statement von
Switch statementSwitch statement
Switch statementPatrick John McGee
2K views8 Folien
Complete C++ programming Language Course von
Complete C++ programming Language CourseComplete C++ programming Language Course
Complete C++ programming Language CourseVivek chan
5.1K views568 Folien

Was ist angesagt?(17)

Solutions manual for absolute java 5th edition by walter savitch von Albern9271
Solutions manual for absolute java 5th edition by walter savitchSolutions manual for absolute java 5th edition by walter savitch
Solutions manual for absolute java 5th edition by walter savitch
Albern92712K views
Ch1 principles of software development von Hattori Sidek
Ch1 principles of software developmentCh1 principles of software development
Ch1 principles of software development
Hattori Sidek2K views
Complete C++ programming Language Course von Vivek chan
Complete C++ programming Language CourseComplete C++ programming Language Course
Complete C++ programming Language Course
Vivek chan5.1K views
Computer Programming, Loops using Java von Mahmoud Alfarra
Computer Programming, Loops using JavaComputer Programming, Loops using Java
Computer Programming, Loops using Java
Mahmoud Alfarra126 views
C language Unit 2 Slides, UPTU C language von Rakesh Roshan
C language Unit 2 Slides, UPTU C languageC language Unit 2 Slides, UPTU C language
C language Unit 2 Slides, UPTU C language
Rakesh Roshan5.7K views
Sample for Simple C Program - R.D.Sivakumar von Sivakumar R D .
Sample for Simple C Program - R.D.SivakumarSample for Simple C Program - R.D.Sivakumar
Sample for Simple C Program - R.D.Sivakumar
Sivakumar R D .50 views
Managing I/O operations In C- Language von RavindraSalunke3
Managing I/O operations In C- LanguageManaging I/O operations In C- Language
Managing I/O operations In C- Language
RavindraSalunke3206 views
Program by Demonstration using Version Space Algebra von Maeda Hanafi
Program by Demonstration using Version Space AlgebraProgram by Demonstration using Version Space Algebra
Program by Demonstration using Version Space Algebra
Maeda Hanafi350 views

Destacado

10 Linked Lists Sacks and Queues von
10 Linked Lists Sacks and Queues10 Linked Lists Sacks and Queues
10 Linked Lists Sacks and Queuespraveenjigajinni
411 views40 Folien
9 Arrays von
9 Arrays9 Arrays
9 Arrayspraveenjigajinni
951 views68 Folien
Qno 3 (a) von
Qno 3 (a)Qno 3 (a)
Qno 3 (a)praveenjigajinni
359 views27 Folien
User Defined Functions von
User Defined FunctionsUser Defined Functions
User Defined Functionspraveenjigajinni
2.3K views69 Folien
Lecture 5 von
Lecture 5Lecture 5
Lecture 5Mohammed Saleh
215 views20 Folien
Lecture 9 von
Lecture 9Lecture 9
Lecture 9Mohammed Saleh
216 views24 Folien

Similar a Lecture 1

Switch case looping von
Switch case loopingSwitch case looping
Switch case loopingCherimay Batallones
417 views60 Folien
Switch case and looping new von
Switch case and looping newSwitch case and looping new
Switch case and looping newaprilyyy
426 views51 Folien
Fundamentals of prog. by rubferd medina von
Fundamentals of prog. by rubferd medinaFundamentals of prog. by rubferd medina
Fundamentals of prog. by rubferd medinarurumedina
249 views40 Folien
My final requirement von
My final requirementMy final requirement
My final requirementkatrinaguevarra29
277 views51 Folien
Macasu, gerrell c. von
Macasu, gerrell c.Macasu, gerrell c.
Macasu, gerrell c.gerrell
232 views51 Folien
My programming final proj. (1) von
My programming final proj. (1)My programming final proj. (1)
My programming final proj. (1)aeden_brines
296 views49 Folien

Similar a Lecture 1(20)

Switch case and looping new von aprilyyy
Switch case and looping newSwitch case and looping new
Switch case and looping new
aprilyyy426 views
Fundamentals of prog. by rubferd medina von rurumedina
Fundamentals of prog. by rubferd medinaFundamentals of prog. by rubferd medina
Fundamentals of prog. by rubferd medina
rurumedina249 views
Macasu, gerrell c. von gerrell
Macasu, gerrell c.Macasu, gerrell c.
Macasu, gerrell c.
gerrell232 views
My programming final proj. (1) von aeden_brines
My programming final proj. (1)My programming final proj. (1)
My programming final proj. (1)
aeden_brines296 views
[C++][a] tutorial 2 von yasir_cesc
[C++][a] tutorial 2[C++][a] tutorial 2
[C++][a] tutorial 2
yasir_cesc341 views
Yeahhhh the final requirement!!! von olracoatalub
Yeahhhh the final requirement!!!Yeahhhh the final requirement!!!
Yeahhhh the final requirement!!!
olracoatalub257 views
Switch case and looping von ChaAstillas
Switch case and loopingSwitch case and looping
Switch case and looping
ChaAstillas388 views

Más de Mohammed Saleh

Lecture 1 von
Lecture 1Lecture 1
Lecture 1Mohammed Saleh
457 views44 Folien
Lecture 3 von
Lecture 3Lecture 3
Lecture 3Mohammed Saleh
327 views35 Folien
Lecture 4 von
Lecture 4Lecture 4
Lecture 4Mohammed Saleh
469 views54 Folien
Lecture 7 von
Lecture 7Lecture 7
Lecture 7Mohammed Saleh
332 views24 Folien
Lecture 6 von
Lecture 6Lecture 6
Lecture 6Mohammed Saleh
409 views44 Folien
Lecture 8 von
Lecture 8Lecture 8
Lecture 8Mohammed Saleh
356 views53 Folien

Último

Gross Anatomy of the Liver von
Gross Anatomy of the LiverGross Anatomy of the Liver
Gross Anatomy of the Liverobaje godwin sunday
267 views12 Folien
My Personal Brand Exploration von
My Personal Brand ExplorationMy Personal Brand Exploration
My Personal Brand ExplorationStephenBradley49
36 views15 Folien
GSoC 2024 .pdf von
GSoC 2024 .pdfGSoC 2024 .pdf
GSoC 2024 .pdfShabNaz2
50 views15 Folien
Introduction to AERO Supply Chain - #BEAERO Trainning program von
Introduction to AERO Supply Chain  - #BEAERO Trainning programIntroduction to AERO Supply Chain  - #BEAERO Trainning program
Introduction to AERO Supply Chain - #BEAERO Trainning programGuennoun Wajih
142 views78 Folien
A Guide to Applying for the Wells Mountain Initiative Scholarship 2023 von
A Guide to Applying for the Wells Mountain Initiative Scholarship 2023A Guide to Applying for the Wells Mountain Initiative Scholarship 2023
A Guide to Applying for the Wells Mountain Initiative Scholarship 2023Excellence Foundation for South Sudan
93 views26 Folien
JRN 362 - Lecture Twenty-Two von
JRN 362 - Lecture Twenty-TwoJRN 362 - Lecture Twenty-Two
JRN 362 - Lecture Twenty-TwoRich Hanley
41 views157 Folien

Último(20)

GSoC 2024 .pdf von ShabNaz2
GSoC 2024 .pdfGSoC 2024 .pdf
GSoC 2024 .pdf
ShabNaz250 views
Introduction to AERO Supply Chain - #BEAERO Trainning program von Guennoun Wajih
Introduction to AERO Supply Chain  - #BEAERO Trainning programIntroduction to AERO Supply Chain  - #BEAERO Trainning program
Introduction to AERO Supply Chain - #BEAERO Trainning program
Guennoun Wajih142 views
JRN 362 - Lecture Twenty-Two von Rich Hanley
JRN 362 - Lecture Twenty-TwoJRN 362 - Lecture Twenty-Two
JRN 362 - Lecture Twenty-Two
Rich Hanley41 views
Education of marginalized and socially disadvantages segments.pptx von GarimaBhati5
Education of marginalized and socially disadvantages segments.pptxEducation of marginalized and socially disadvantages segments.pptx
Education of marginalized and socially disadvantages segments.pptx
GarimaBhati559 views
Creative Restart 2023: Christophe Wechsler - From the Inside Out: Cultivating... von Taste
Creative Restart 2023: Christophe Wechsler - From the Inside Out: Cultivating...Creative Restart 2023: Christophe Wechsler - From the Inside Out: Cultivating...
Creative Restart 2023: Christophe Wechsler - From the Inside Out: Cultivating...
Taste39 views
Guidelines & Identification of Early Sepsis DR. NN CHAVAN 02122023.pptx von Niranjan Chavan
Guidelines & Identification of Early Sepsis DR. NN CHAVAN 02122023.pptxGuidelines & Identification of Early Sepsis DR. NN CHAVAN 02122023.pptx
Guidelines & Identification of Early Sepsis DR. NN CHAVAN 02122023.pptx
Niranjan Chavan48 views
Peripheral artery diseases by Dr. Garvit.pptx von garvitnanecha
Peripheral artery diseases by Dr. Garvit.pptxPeripheral artery diseases by Dr. Garvit.pptx
Peripheral artery diseases by Dr. Garvit.pptx
garvitnanecha147 views
OOPs - JAVA Quick Reference.pdf von ArthyR3
OOPs - JAVA Quick Reference.pdfOOPs - JAVA Quick Reference.pdf
OOPs - JAVA Quick Reference.pdf
ArthyR380 views
From social media to generative media (3).pptx von Mark Carrigan
From social media to generative media (3).pptxFrom social media to generative media (3).pptx
From social media to generative media (3).pptx
Mark Carrigan88 views
Artificial Intelligence and The Sustainable Development Goals (SDGs) Adoption... von BC Chew
Artificial Intelligence and The Sustainable Development Goals (SDGs) Adoption...Artificial Intelligence and The Sustainable Development Goals (SDGs) Adoption...
Artificial Intelligence and The Sustainable Development Goals (SDGs) Adoption...
BC Chew55 views
Guess Papers ADC 1, Karachi University von Khalid Aziz
Guess Papers ADC 1, Karachi UniversityGuess Papers ADC 1, Karachi University
Guess Papers ADC 1, Karachi University
Khalid Aziz119 views
Interaction of microorganisms with vascular plants.pptx von MicrobiologyMicro
Interaction of microorganisms with vascular plants.pptxInteraction of microorganisms with vascular plants.pptx
Interaction of microorganisms with vascular plants.pptx

Lecture 1

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33. 1. Comments 2. Load <iostream> 3. main 3.1 Print &quot;Welcome to C++&quot; 3.2 exit ( return 0 ) Program Output Hello World ! 1 // firstcpp.cpp 2 // A first program in C++ 3 #include <iostream> 4 5 int main() 6 { 7 cout << ”Hello World!&quot;; 8 9 return 0; // indicate that program ended successfully 10 } preprocessor directive Message to the C++ preprocessor. Lines beginning with # are preprocessor directives. #include <iostream> tells the preprocessor to include the contents of the file <iostream> , which includes input/output operations (such as printing to the screen). Comments Written between /* and */ or following a // . Improve program readability and do not cause the computer to perform any action. C++ programs contain one or more functions, one of which must be main Parenthesis are used to indicate a function int means that main &quot;returns&quot; an integer value. A left brace { begins the body of every function and a right brace } ends it. Prints the string of characters contained between the quotation marks. The entire line, including std::cout , the << operator , the string ”Hello World !&quot; and the semicolon ( ; ), is called a statement . All statements must end with a semicolon. return is a way to exit a function from a function. return 0 , in this case, means that the program terminated normally.
  • 34.
  • 35.
  • 36.
  • 37. 1. Load <iostream> 2. main 2.1 Print &quot;Welcome&quot; 2.2 Print &quot;to C++!&quot; 2.3 newline 2.4 exit ( return 0 ) Program Output Hello World ! 1 // firstcpp.cpp 2 // Printing a line with multiple statements 3 #include <iostream> 4 5 int main() 6 { 7 std::cout << ”Hello &quot;; 8 std::cout << ”World !&quot;; 9 10 return 0; // indicate that program ended successfully 11 } Unless new line '' is specified, the text continues on the same line.
  • 38. 1. Load <iostream> 2. main 2.1 Print &quot;Welcome&quot; 2.2 newline 2.3 Print &quot;to&quot; 2.4 newline 2.5 newline 2.6 Print &quot;C++!&quot; 2.7 newline 2.8 exit ( return 0 ) Program Output Hello   World ! 1 // firstcpp.cpp 2 // Printing multiple lines with a single statement 3 #include <iostream> 4 5 int main() 6 { 7 std::cout << ”Hello World !&quot;; 8 9 return 0; // indicate that program ended successfully 10 } Multiple lines can be printed with one statement.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.

Hinweis der Redaktion

  1. 09/22/09 Programming Languages C Plus Plus
  2. 09/22/09 Programming Languages C Plus Plus
  3. 09/22/09 Programming Languages C Plus Plus
  4. The IF statement selects or ignores a single action. 09/22/09 Programming Languages C Plus Plus
  5. 09/22/09 Programming Languages C Plus Plus
  6. 09/22/09 Programming Languages C Plus Plus
  7. 09/22/09 Programming Languages C Plus Plus
  8. 09/22/09 Programming Languages C Plus Plus
  9. 09/22/09 Programming Languages C Plus Plus
  10. 09/22/09 Programming Languages C Plus Plus
  11. 09/22/09 Programming Languages C Plus Plus
  12. 09/22/09 Programming Languages C Plus Plus
  13. 09/22/09 Programming Languages C Plus Plus
  14. 09/22/09 Programming Languages C Plus Plus
  15. 09/22/09 Programming Languages C Plus Plus
  16. 09/22/09 Programming Languages C Plus Plus
  17. 09/22/09 Programming Languages C Plus Plus
  18. 09/22/09 Programming Languages C Plus Plus
  19. Most often, labels are simple int or char constants, such as 1or ‘q’ 09/22/09 Programming Languages C Plus Plus
  20. Most often, labels are simple int or char constants, such as 1or ‘q’ 09/22/09 Programming Languages C Plus Plus
  21. 09/22/09 Programming Languages C Plus Plus
  22. 09/22/09 Programming Languages C Plus Plus
  23. 09/22/09 Programming Languages C Plus Plus
  24. 09/22/09 Programming Languages C Plus Plus
  25. 09/22/09 Programming Languages C Plus Plus
  26. 09/22/09 Programming Languages C Plus Plus
  27. 09/22/09 Programming Languages C Plus Plus
  28. 09/22/09 Programming Languages C Plus Plus
  29. 09/22/09 Programming Languages C Plus Plus
  30. 09/22/09 Programming Languages C Plus Plus
  31. 09/22/09 Programming Languages C Plus Plus
  32. 09/22/09 Programming Languages C Plus Plus