SlideShare a Scribd company logo
1 of 21
LAB 2
Programming with C++
Main part in C++ program
#include<iostream.h>
void main()
{

          Any code will be written here

}
How to open C++

START
Variables
•   Integer (int).
•   Decimal (float,double).
•   Character (char).
•   Boolean (true / false).
Example1
         Pseudocode                    C++
1. Read length.            • int length,area;
2. area = length*length.     cin>>length;
3. Print area.             • area = length*length;
                           • cout<<“area=“<<area;
Example2


• Write a program to calculate the summation
 of two numbers.

More Related Content

What's hot

Write declarations for each of the following variables: a. amounts is a...
Write declarations for each of the following variables:       a. amounts is a...Write declarations for each of the following variables:       a. amounts is a...
Write declarations for each of the following variables: a. amounts is a...licservernoida
 
Intermediate code generation
Intermediate code generationIntermediate code generation
Intermediate code generationRamchandraRegmi
 
Lecture 12 intermediate code generation
Lecture 12 intermediate code generationLecture 12 intermediate code generation
Lecture 12 intermediate code generationIffat Anjum
 
Csc1100 lecture10 ch08_pt1
Csc1100 lecture10 ch08_pt1Csc1100 lecture10 ch08_pt1
Csc1100 lecture10 ch08_pt1IIUM
 
Code generator
Code generatorCode generator
Code generatorTech_MX
 
Arithmetic Operations
Arithmetic OperationsArithmetic Operations
Arithmetic Operationsgueste99d9a
 
COMPILER DESIGN AND CONSTRUCTION
COMPILER DESIGN AND CONSTRUCTIONCOMPILER DESIGN AND CONSTRUCTION
COMPILER DESIGN AND CONSTRUCTIONAnil Pokhrel
 
Polish Notation In Data Structure
Polish Notation In Data StructurePolish Notation In Data Structure
Polish Notation In Data StructureMeghaj Mallick
 
Aae oop xp_06
Aae oop xp_06Aae oop xp_06
Aae oop xp_06Niit Care
 
Csc1100 lecture12 ch08_pt2
Csc1100 lecture12 ch08_pt2Csc1100 lecture12 ch08_pt2
Csc1100 lecture12 ch08_pt2IIUM
 
Chapter 6 intermediate code generation
Chapter 6   intermediate code generationChapter 6   intermediate code generation
Chapter 6 intermediate code generationVipul Naik
 

What's hot (20)

Write declarations for each of the following variables: a. amounts is a...
Write declarations for each of the following variables:       a. amounts is a...Write declarations for each of the following variables:       a. amounts is a...
Write declarations for each of the following variables: a. amounts is a...
 
Task python
Task pythonTask python
Task python
 
Intermediate code generation
Intermediate code generationIntermediate code generation
Intermediate code generation
 
Ch9b
Ch9bCh9b
Ch9b
 
Lecture 12 intermediate code generation
Lecture 12 intermediate code generationLecture 12 intermediate code generation
Lecture 12 intermediate code generation
 
Csc1100 lecture10 ch08_pt1
Csc1100 lecture10 ch08_pt1Csc1100 lecture10 ch08_pt1
Csc1100 lecture10 ch08_pt1
 
Code generator
Code generatorCode generator
Code generator
 
Ch9a
Ch9aCh9a
Ch9a
 
Code optimization
Code optimizationCode optimization
Code optimization
 
Arithmetic Operations
Arithmetic OperationsArithmetic Operations
Arithmetic Operations
 
Compilers Final spring 2013 model answer
 Compilers Final spring 2013 model answer Compilers Final spring 2013 model answer
Compilers Final spring 2013 model answer
 
COMPILER DESIGN AND CONSTRUCTION
COMPILER DESIGN AND CONSTRUCTIONCOMPILER DESIGN AND CONSTRUCTION
COMPILER DESIGN AND CONSTRUCTION
 
System software
System softwareSystem software
System software
 
Polish Notation In Data Structure
Polish Notation In Data StructurePolish Notation In Data Structure
Polish Notation In Data Structure
 
Aae oop xp_06
Aae oop xp_06Aae oop xp_06
Aae oop xp_06
 
Intermediate code generation
Intermediate code generationIntermediate code generation
Intermediate code generation
 
Pointers
PointersPointers
Pointers
 
Ch8a
Ch8aCh8a
Ch8a
 
Csc1100 lecture12 ch08_pt2
Csc1100 lecture12 ch08_pt2Csc1100 lecture12 ch08_pt2
Csc1100 lecture12 ch08_pt2
 
Chapter 6 intermediate code generation
Chapter 6   intermediate code generationChapter 6   intermediate code generation
Chapter 6 intermediate code generation
 

Viewers also liked

Practical basics on c++
Practical basics on c++Practical basics on c++
Practical basics on c++Marco Izzotti
 
Practical C++ Generative Programming
Practical C++ Generative ProgrammingPractical C++ Generative Programming
Practical C++ Generative ProgrammingSchalk Cronjé
 
Lab manual of C++
Lab manual of C++Lab manual of C++
Lab manual of C++thesaqib
 
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board ExamsC++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board Examshishamrizvi
 
12th CBSE Practical File
12th CBSE Practical File12th CBSE Practical File
12th CBSE Practical FileAshwin Francis
 
C++ project on police station software
C++ project on police station softwareC++ project on police station software
C++ project on police station softwaredharmenderlodhi021
 
Computer science project work
Computer science project workComputer science project work
Computer science project workrahulchamp2345
 

Viewers also liked (11)

C++ TUTORIAL 6
C++ TUTORIAL 6C++ TUTORIAL 6
C++ TUTORIAL 6
 
C++
C++C++
C++
 
Practical basics on c++
Practical basics on c++Practical basics on c++
Practical basics on c++
 
C++ practical lab
C++ practical labC++ practical lab
C++ practical lab
 
Practical C++ Generative Programming
Practical C++ Generative ProgrammingPractical C++ Generative Programming
Practical C++ Generative Programming
 
c++ lab manual
c++ lab manualc++ lab manual
c++ lab manual
 
Lab manual of C++
Lab manual of C++Lab manual of C++
Lab manual of C++
 
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board ExamsC++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
C++ Notes by Hisham Ahmed Rizvi for Class 12th Board Exams
 
12th CBSE Practical File
12th CBSE Practical File12th CBSE Practical File
12th CBSE Practical File
 
C++ project on police station software
C++ project on police station softwareC++ project on police station software
C++ project on police station software
 
Computer science project work
Computer science project workComputer science project work
Computer science project work
 

C++:Lab 2

  • 2. Main part in C++ program #include<iostream.h> void main() { Any code will be written here }
  • 3. How to open C++ START
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19. Variables • Integer (int). • Decimal (float,double). • Character (char). • Boolean (true / false).
  • 20. Example1 Pseudocode C++ 1. Read length. • int length,area; 2. area = length*length. cin>>length; 3. Print area. • area = length*length; • cout<<“area=“<<area;
  • 21. Example2 • Write a program to calculate the summation of two numbers.