Upload
-
View
116
Download
3
Embed Size (px)
Citation preview
LAB 2Programming 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
1. Read length.
2. area = length*length.
3. Print area.
C++
• int length,area;
cin>>length;
• area = length*length;
• cout<<“area=“<<area;
Example2
• Write a program to calculate the summation
of two numbers.