Dilkhush Kumar (C++ Language)
Dilkhush Kumar (C++ Language)
FLOWCHART
Predefined
Process/Function Represents a group of
statements performing
one processing task.
1. Start
4. Display sum
5. Stop
EXPERIMENT NO:-1
#include<iostream.h>
#include<conio.h> int
main()
cin>>b; sum=a+b;
cout<<"sum is="<<sum;
getch();
return 0;
OUTPUT:-
EXPERIMENT:-2
Q. Write a program to substract two number?
#include<iostream.h>
#include<conio.h> int
main()
{
int a,b,substract;
cout<<"enter number a=";
cin>>a;
cout<<"enter number b=";
cin>>b; substract=a-b;
cout<<"substract is="<<substract;
getch();
return 0;
}
OUTPUT:-
EXPERIMENT NO:-3
Q. Write a program to multiply two numbers?
#include<iostream.h>
#include<conio.h> int
main()
{
int a,b,multiply;
cout<<"enter number a=";
cin>>a;
cout<<"enter number b=";
cin>>b; multiply=a*b;
cout<<"multiply is="<<multiply;
getch();
return 0;
}
OUTPUT:-
EXPRIMENT NO:-4
Q. write a program to division two number?
#include<iostream.h>
#include<conio.h> int
main()
{
int a,b,division;
cout<<"enter number a=";
cin>>a;
cout<<"enter number b=";
cin>>b; division=a/b;
cout<<"division is="<<division;
getch();
return 0;
}
OUTPUT:
EXPRIMENT NO:-5
Q. Program to convert temperature given in Fahrenheit to the one in Celsius?
#include<iostream.h>
#include<conio.h> int
main()
{
Float c,f;
Cout<<” enter temperature in Fahrenheit=”; C=(float)5/9*(f-32);
cout<<"temperature in Celsius ="<<c;
getch();
return 0;
}
OUTPUT:-
EXPRIMENT NO:-6
Q. Program to calculate the area and parameter of a rectangle?
#include<iostream.h>
#include<conio.h> int
main ()
{
Int length,width,area,perimeter;
Cout<<” enter length” <<end l;
Cin>>length;
Cout<<” enter width” <<end l;
Cin>>width;
Area=l*b; Perimeter=2*(l+b);
getch();
return 0;
}
OUTPUT: -
EXPRIMENT NO:-7
Q. Program to calculate the simple interest?
#include<iostream.h>
#include<conio.h> int
main ()
{
Float p,f,t,si;
Clrscr;
Cout<<”enter principal rate time=n”;
Cin>>p>>r>>t; Si=(p*r*t)/100;
cout<<"simple interest ="<<si;
getch();
return 0;
}
OUTPUT: -
Variables: Variable is the name of a memory location which stores some data.
▪ Variables Rules:
1. Variables are case sensitive
2. 1st character is alphabet or '_'
3. no comma/blank space
4. No other symbol other than '_’
Constants: Values that don't change(fixed)
Type
Keywords: Reserved words that have special meaning to the compiler.(32 keywords in c)
OPERATORS
a. Arithmetic Operators
b. Relational Operators
d. Bitwise Operators
c. Logical Operators
e. Assignment Operator
f. Ternary Operatar