Programming Experiment
Programming Experiment
College of Computing
Department of Computer Science
Computer Programming
Laboratory Practice
Lab. Inst. Andualem D.
Experiment 1/cout Experiment 4/subtraction
#include<iostream> #include<iostream>
using namespace std; using namespace std;
#include<conio.h> #include<conio.h>
int main() { int main() {
cout<<"Hello World\n"; int m,n,sub;
cout<<"This is my first C++ programming"; cout<<"This program will calculate the Two
getch(); numbers"<<endl;
return 0; cout<<"pls enter the value of the m and n number\n";
} cin>>m>>n;
Experiment 2/cout sub=m-n;
#include<iostream> cout<<"The sub of Two numbers is:\t"<<sub<<endl;
using namespace std; getch ();
#include<conio.h> return 0;}
int main() { Experiment 5/multiplication
cout<<"\tMy Name is:- Mr. Johan Bruz\n"; #include<iostream>//library file
cout<<"\tSex:-Male"<<endl; #include<conio.h>
cout<<"\tAge:- 25\n"; using namespace std;
cout<<"\tAddress: Austria”<<endl; int main(){
getch(); int g,h,mult;
return 0; cout<<"This program will calculate the Two
Experiment 3/addition numbers"<<endl;
#include<iostream>//library file cout<<"pls enter the value of the g and h number\n";
#include<conio.h> cin>>m>>n;
using namespace std; mult=g*h;
int main(){ cout<<"The product of Two numbers
int m,n,sum; is:\t"<<mult<<endl;
cout<<"This program will calculate the Two getch ();
numbers"<<endl; return 0;
cout<<"pls enter the value of the m and n number\n"; }
cin>>m>>n; Experiment 6/division
sum=m+n; #include<iostream>//library file
cout<<"The sum of Two numbers is:\t"<<sum<<endl; #include<conio.h>
getch(); using namespace std;
getch(); int main(){
return 0; int j,f;
} float div;
cout<<"This program will calculate the Two
numbers"<<endl;
cout<<"pls enter the value of the j and f number\n";
cin>>j>>f;
div=j/f;
cout<<"The division of Two numbers is:\t"<<div<<endl;
getch ();