SlideShare a Scribd company logo
1 of 8
Quaid-e-Awam University of Engineering Science & Technology
Nawabshah
OOP(Object Oriented Programming)
Lab#2
Program#1
#include<iostream>
#include<conio.h>
Using namespace std;
int main()
{
int rad;
float pi=3.14;
cout<<”Enter The Value of Radius=”;
cin>>a;
cout<<”Circumfrance of Circle is =”<<2*(pi*rad)<<endl;
cout<<”Area of Circle is =”<<pi*(rad*rad)<<endl;
getche();
}
Quaid-e-Awam University of Engineering Science & Technology
Nawabshah
OOP(Object Oriented Programming)
Lab#2
Program#2
#include<iostream>
#include<conio.h>
Using namespace std;
Int main()
{
int a,b;
cout<<”**************************”;
cout<<”tCalculator”;
cout<<”**************************”;
cout<<”Enter First Value=”;
cin>>a;
cout<<”Enter Second Value=”;
cin>>b;
cout<<”Result of Addition Operation Is =”<<a+b<<endl;
cout<<”Result of Subtraction Operation Is =”<<a-b<<endl;
cout<<”Result of Multiplication Operation Is =”<<a*b<<endl;
cout<<”Result of Divisionion Operation Is =”<<a/b<<endl;
getche();
}
Quaid-e-Awam University of Engineering Science & Technology
Nawabshah
OOP(Object Oriented Programming)
Lab#2
Program#3
#include<iostream>
#include<conio.h>
Using namespace std;
int main()
{
int ctemp;
float ftemp;
cout<<”Enter Temperature in Celcius=”;
cin>>ctemp;
ftemp=ctemp*(9/5+32);
cout<<”Temperature in Farhenheight=”<<ftemp<<endl;
getche();
}
Quaid-e-Awam University of Engineering Science & Technology
Nawabshah
OOP(Object Oriented Programming)
Lab#2
Program#4
#include<iostream>
#include<conio.h>
Using namespace std;
int main()
{
int a;
cout<<”Enter Integer Value=”;
cin>>a;
cout<<”Square of Integer is =”<<a*a<<endl;
getche();
Quaid-e-Awam University of Engineering Science & Technology
Nawabshah
OOP(Object Oriented Programming)
Lab#2
Program#5
#include<iostream>
#include<conio.h>
Using namespace std;
int main()
{
int s1,s2,s3s4,s5,avg,tot,obt;
float per;
cout<<”Enter First Subject Marks=”;
cin>>s1;
cout<<”Enter Second Subject Marks=”;
cin>>s2;
cout<<”Enter Third Subject Marks=”;
cin>>s3;
cout<<”Enter Fourth Subject Marks=”;
cin>>s4;
cout<<”Enter Fifth Subject Marks=”;
cin>>s5;
cout<<”Enter Total Marks=”;
cin>>tot;
Quaid-e-Awam University of Engineering Science & Technology
Nawabshah
OOP(Object Oriented Programming)
Lab#2
obt=s1+s2+s3+s4+s5;
cout<<”Your Obtained Marks are”<<obt<<endl;
per=(obt*100)/tot;
cout<<”Your Percentage is=”<<per<<endl;
avg=obt/5;
cout<<”Your Average is=”<<avg<<endl;
getche();
}
Quaid-e-Awam University of Engineering Science & Technology
Nawabshah
OOP(Object Oriented Programming)
Lab#2
Program#6
#include<iostream>
#include<conio.h>
Using namespace std;
int main()
{
int a=10;
cout<<a<<endl;
a=a+a;
cout<<a<<endl;
a--;
cout<<a<<endl;
getche();
}
Quaid-e-Awam University of Engineering Science & Technology
Nawabshah
OOP(Object Oriented Programming)
Lab#2
Program#7
#include<iostream>
#include<conio.h>
Using namespace std;
int main()
{
cout<<”CCCCCCCCCC”<<”t++t”<<”t++”<<endl;
cout<<”CCt”<<”t++t”<<”t++”<<endl;
cout<<”CCt” ++++++++++++++”<<” ++++++++++++++”<<endl;
cout<<”CCt” ++++++++++++++”<<” ++++++++++++++”<<endl;
cout<<”CCt”<<”t++t”<<”t++”<<endl;
cout<<”CCCCCCCCCC”<<”t++t”<<”t++”<<endl;
getche();
}

More Related Content

What's hot

Grand centraldispatch
Grand centraldispatchGrand centraldispatch
Grand centraldispatchYuumi Yoshida
 
Quick 入門 | iOS RDD テストフレームワーク for Swift/Objective-C
Quick 入門 | iOS RDD テストフレームワーク for Swift/Objective-CQuick 入門 | iOS RDD テストフレームワーク for Swift/Objective-C
Quick 入門 | iOS RDD テストフレームワーク for Swift/Objective-CYuki Tanabe
 
Post-processing SAR images on Xeon Phi - a porting exercise
Post-processing SAR images on Xeon Phi - a porting exercisePost-processing SAR images on Xeon Phi - a porting exercise
Post-processing SAR images on Xeon Phi - a porting exerciseIntel IT Center
 
Goの時刻に関するテスト
Goの時刻に関するテストGoの時刻に関するテスト
Goの時刻に関するテストKentaro Kawano
 
Linked list : Doubly Linked List
Linked list : Doubly Linked ListLinked list : Doubly Linked List
Linked list : Doubly Linked ListDestro Destro
 
Data structure programs in c++
Data structure programs in c++Data structure programs in c++
Data structure programs in c++mmirfan
 
Accumulo Summit 2014: Accumulo backed Tinkerpop Implementation
Accumulo Summit 2014: Accumulo backed Tinkerpop ImplementationAccumulo Summit 2014: Accumulo backed Tinkerpop Implementation
Accumulo Summit 2014: Accumulo backed Tinkerpop ImplementationAccumulo Summit
 
function* - ES6, generators, and all that (JSRomandie meetup, February 2014)
function* - ES6, generators, and all that (JSRomandie meetup, February 2014)function* - ES6, generators, and all that (JSRomandie meetup, February 2014)
function* - ES6, generators, and all that (JSRomandie meetup, February 2014)Igalia
 
C- Programs - Harsh
C- Programs - HarshC- Programs - Harsh
C- Programs - HarshHarsh Sharma
 

What's hot (20)

Ragel talk
Ragel talkRagel talk
Ragel talk
 
Grand centraldispatch
Grand centraldispatchGrand centraldispatch
Grand centraldispatch
 
2 a networkflow
2 a networkflow2 a networkflow
2 a networkflow
 
Quick 入門 | iOS RDD テストフレームワーク for Swift/Objective-C
Quick 入門 | iOS RDD テストフレームワーク for Swift/Objective-CQuick 入門 | iOS RDD テストフレームワーク for Swift/Objective-C
Quick 入門 | iOS RDD テストフレームワーク for Swift/Objective-C
 
Sol10
Sol10Sol10
Sol10
 
Concurrency in Python4k
Concurrency in Python4kConcurrency in Python4k
Concurrency in Python4k
 
Node.js testing
Node.js testingNode.js testing
Node.js testing
 
Post-processing SAR images on Xeon Phi - a porting exercise
Post-processing SAR images on Xeon Phi - a porting exercisePost-processing SAR images on Xeon Phi - a porting exercise
Post-processing SAR images on Xeon Phi - a porting exercise
 
Goの時刻に関するテスト
Goの時刻に関するテストGoの時刻に関するテスト
Goの時刻に関するテスト
 
Linked list : Doubly Linked List
Linked list : Doubly Linked ListLinked list : Doubly Linked List
Linked list : Doubly Linked List
 
Sol7
Sol7Sol7
Sol7
 
Data structure programs in c++
Data structure programs in c++Data structure programs in c++
Data structure programs in c++
 
Stack switching for fun and profit
Stack switching for fun and profitStack switching for fun and profit
Stack switching for fun and profit
 
Accumulo Summit 2014: Accumulo backed Tinkerpop Implementation
Accumulo Summit 2014: Accumulo backed Tinkerpop ImplementationAccumulo Summit 2014: Accumulo backed Tinkerpop Implementation
Accumulo Summit 2014: Accumulo backed Tinkerpop Implementation
 
function* - ES6, generators, and all that (JSRomandie meetup, February 2014)
function* - ES6, generators, and all that (JSRomandie meetup, February 2014)function* - ES6, generators, and all that (JSRomandie meetup, February 2014)
function* - ES6, generators, and all that (JSRomandie meetup, February 2014)
 
Spark Jobserver
Spark JobserverSpark Jobserver
Spark Jobserver
 
Array and functions
Array and functionsArray and functions
Array and functions
 
C++ assignment
C++ assignmentC++ assignment
C++ assignment
 
C- Programs - Harsh
C- Programs - HarshC- Programs - Harsh
C- Programs - Harsh
 
Storm is coming
Storm is comingStorm is coming
Storm is coming
 

Viewers also liked

Mr. Altaf Hussain (MQM) Founder & Leader with Leadership Style.
Mr. Altaf Hussain (MQM) Founder & Leader with Leadership Style.Mr. Altaf Hussain (MQM) Founder & Leader with Leadership Style.
Mr. Altaf Hussain (MQM) Founder & Leader with Leadership Style.Syed Minhaj Rehman
 
Change and innovation_management
Change and innovation_managementChange and innovation_management
Change and innovation_managementcnaasir7
 
A short essay on Mohammad Ali Jannah
A short essay on Mohammad Ali Jannah A short essay on Mohammad Ali Jannah
A short essay on Mohammad Ali Jannah Ali Shah
 
Muhammad ali jinnah biography and role
Muhammad ali jinnah biography and roleMuhammad ali jinnah biography and role
Muhammad ali jinnah biography and roleAdnan Ali
 
role of leadership - sir syed ahmad khan - allama iqbal - quaid-e-azam muhamm...
role of leadership - sir syed ahmad khan - allama iqbal - quaid-e-azam muhamm...role of leadership - sir syed ahmad khan - allama iqbal - quaid-e-azam muhamm...
role of leadership - sir syed ahmad khan - allama iqbal - quaid-e-azam muhamm...Faizan Shabbir
 
Marketing Project on Engro foods
Marketing Project on Engro foodsMarketing Project on Engro foods
Marketing Project on Engro foodsJunaid Shahid
 
Leaders are born and not made
Leaders are born and not madeLeaders are born and not made
Leaders are born and not madeMutua Anthony
 
The Great Leader M A Jinnah
The Great Leader M A JinnahThe Great Leader M A Jinnah
The Great Leader M A Jinnahkharison
 
Quaid e azam
Quaid e azamQuaid e azam
Quaid e azamMAYA KHAN
 

Viewers also liked (11)

Mr. Altaf Hussain (MQM) Founder & Leader with Leadership Style.
Mr. Altaf Hussain (MQM) Founder & Leader with Leadership Style.Mr. Altaf Hussain (MQM) Founder & Leader with Leadership Style.
Mr. Altaf Hussain (MQM) Founder & Leader with Leadership Style.
 
Man101 Chapter7
Man101 Chapter7Man101 Chapter7
Man101 Chapter7
 
Change and innovation_management
Change and innovation_managementChange and innovation_management
Change and innovation_management
 
Quaid I Azam - Mohammad Ali Jinnah
Quaid I Azam - Mohammad Ali JinnahQuaid I Azam - Mohammad Ali Jinnah
Quaid I Azam - Mohammad Ali Jinnah
 
A short essay on Mohammad Ali Jannah
A short essay on Mohammad Ali Jannah A short essay on Mohammad Ali Jannah
A short essay on Mohammad Ali Jannah
 
Muhammad ali jinnah biography and role
Muhammad ali jinnah biography and roleMuhammad ali jinnah biography and role
Muhammad ali jinnah biography and role
 
role of leadership - sir syed ahmad khan - allama iqbal - quaid-e-azam muhamm...
role of leadership - sir syed ahmad khan - allama iqbal - quaid-e-azam muhamm...role of leadership - sir syed ahmad khan - allama iqbal - quaid-e-azam muhamm...
role of leadership - sir syed ahmad khan - allama iqbal - quaid-e-azam muhamm...
 
Marketing Project on Engro foods
Marketing Project on Engro foodsMarketing Project on Engro foods
Marketing Project on Engro foods
 
Leaders are born and not made
Leaders are born and not madeLeaders are born and not made
Leaders are born and not made
 
The Great Leader M A Jinnah
The Great Leader M A JinnahThe Great Leader M A Jinnah
The Great Leader M A Jinnah
 
Quaid e azam
Quaid e azamQuaid e azam
Quaid e azam
 

Similar to OOP Lab Programs Circumference Area Calculator

Tugas praktikukm pemrograman c++
Tugas praktikukm  pemrograman c++Tugas praktikukm  pemrograman c++
Tugas praktikukm pemrograman c++Dendi Riadi
 
2 BytesC++ course_2014_c3_ function basics&parameters and overloading
2 BytesC++ course_2014_c3_ function basics&parameters and overloading2 BytesC++ course_2014_c3_ function basics&parameters and overloading
2 BytesC++ course_2014_c3_ function basics&parameters and overloadingkinan keshkeh
 
Pads lab manual final
Pads lab manual finalPads lab manual final
Pads lab manual finalAhalyaR
 
BPOPS203 PRINCIPLES OF PROGRAMMING USING C LAB Manual.pdf
BPOPS203 PRINCIPLES OF PROGRAMMING USING C LAB Manual.pdfBPOPS203 PRINCIPLES OF PROGRAMMING USING C LAB Manual.pdf
BPOPS203 PRINCIPLES OF PROGRAMMING USING C LAB Manual.pdfSyed Mustafa
 
Евгений Крутько, Многопоточные вычисления, современный подход.
Евгений Крутько, Многопоточные вычисления, современный подход.Евгений Крутько, Многопоточные вычисления, современный подход.
Евгений Крутько, Многопоточные вычисления, современный подход.Platonov Sergey
 
Modern C++ Explained: Move Semantics (Feb 2018)
Modern C++ Explained: Move Semantics (Feb 2018)Modern C++ Explained: Move Semantics (Feb 2018)
Modern C++ Explained: Move Semantics (Feb 2018)Olve Maudal
 
12. stl örnekler
12.  stl örnekler12.  stl örnekler
12. stl örneklerkarmuhtam
 

Similar to OOP Lab Programs Circumference Area Calculator (20)

Tugas praktikukm pemrograman c++
Tugas praktikukm  pemrograman c++Tugas praktikukm  pemrograman c++
Tugas praktikukm pemrograman c++
 
Oops lab manual
Oops lab manualOops lab manual
Oops lab manual
 
C++ Programs
C++ ProgramsC++ Programs
C++ Programs
 
oodp elab.pdf
oodp elab.pdfoodp elab.pdf
oodp elab.pdf
 
Pointers
PointersPointers
Pointers
 
P1
P1P1
P1
 
2 BytesC++ course_2014_c3_ function basics&parameters and overloading
2 BytesC++ course_2014_c3_ function basics&parameters and overloading2 BytesC++ course_2014_c3_ function basics&parameters and overloading
2 BytesC++ course_2014_c3_ function basics&parameters and overloading
 
Lecture2.ppt
Lecture2.pptLecture2.ppt
Lecture2.ppt
 
Oop lab report
Oop lab reportOop lab report
Oop lab report
 
C++ file
C++ fileC++ file
C++ file
 
C++ file
C++ fileC++ file
C++ file
 
Pads lab manual final
Pads lab manual finalPads lab manual final
Pads lab manual final
 
BPOPS203 PRINCIPLES OF PROGRAMMING USING C LAB Manual.pdf
BPOPS203 PRINCIPLES OF PROGRAMMING USING C LAB Manual.pdfBPOPS203 PRINCIPLES OF PROGRAMMING USING C LAB Manual.pdf
BPOPS203 PRINCIPLES OF PROGRAMMING USING C LAB Manual.pdf
 
C++ manual Report Full
C++ manual Report FullC++ manual Report Full
C++ manual Report Full
 
C++ programming basics
C++ programming basicsC++ programming basics
C++ programming basics
 
Евгений Крутько, Многопоточные вычисления, современный подход.
Евгений Крутько, Многопоточные вычисления, современный подход.Евгений Крутько, Многопоточные вычисления, современный подход.
Евгений Крутько, Многопоточные вычисления, современный подход.
 
Permute
PermutePermute
Permute
 
Modern C++ Explained: Move Semantics (Feb 2018)
Modern C++ Explained: Move Semantics (Feb 2018)Modern C++ Explained: Move Semantics (Feb 2018)
Modern C++ Explained: Move Semantics (Feb 2018)
 
Oops presentation
Oops presentationOops presentation
Oops presentation
 
12. stl örnekler
12.  stl örnekler12.  stl örnekler
12. stl örnekler
 

OOP Lab Programs Circumference Area Calculator

  • 1. Quaid-e-Awam University of Engineering Science & Technology Nawabshah OOP(Object Oriented Programming) Lab#2 Program#1 #include<iostream> #include<conio.h> Using namespace std; int main() { int rad; float pi=3.14; cout<<”Enter The Value of Radius=”; cin>>a; cout<<”Circumfrance of Circle is =”<<2*(pi*rad)<<endl; cout<<”Area of Circle is =”<<pi*(rad*rad)<<endl; getche(); }
  • 2. Quaid-e-Awam University of Engineering Science & Technology Nawabshah OOP(Object Oriented Programming) Lab#2 Program#2 #include<iostream> #include<conio.h> Using namespace std; Int main() { int a,b; cout<<”**************************”; cout<<”tCalculator”; cout<<”**************************”; cout<<”Enter First Value=”; cin>>a; cout<<”Enter Second Value=”; cin>>b; cout<<”Result of Addition Operation Is =”<<a+b<<endl; cout<<”Result of Subtraction Operation Is =”<<a-b<<endl; cout<<”Result of Multiplication Operation Is =”<<a*b<<endl; cout<<”Result of Divisionion Operation Is =”<<a/b<<endl; getche(); }
  • 3. Quaid-e-Awam University of Engineering Science & Technology Nawabshah OOP(Object Oriented Programming) Lab#2 Program#3 #include<iostream> #include<conio.h> Using namespace std; int main() { int ctemp; float ftemp; cout<<”Enter Temperature in Celcius=”; cin>>ctemp; ftemp=ctemp*(9/5+32); cout<<”Temperature in Farhenheight=”<<ftemp<<endl; getche(); }
  • 4. Quaid-e-Awam University of Engineering Science & Technology Nawabshah OOP(Object Oriented Programming) Lab#2 Program#4 #include<iostream> #include<conio.h> Using namespace std; int main() { int a; cout<<”Enter Integer Value=”; cin>>a; cout<<”Square of Integer is =”<<a*a<<endl; getche();
  • 5. Quaid-e-Awam University of Engineering Science & Technology Nawabshah OOP(Object Oriented Programming) Lab#2 Program#5 #include<iostream> #include<conio.h> Using namespace std; int main() { int s1,s2,s3s4,s5,avg,tot,obt; float per; cout<<”Enter First Subject Marks=”; cin>>s1; cout<<”Enter Second Subject Marks=”; cin>>s2; cout<<”Enter Third Subject Marks=”; cin>>s3; cout<<”Enter Fourth Subject Marks=”; cin>>s4; cout<<”Enter Fifth Subject Marks=”; cin>>s5; cout<<”Enter Total Marks=”; cin>>tot;
  • 6. Quaid-e-Awam University of Engineering Science & Technology Nawabshah OOP(Object Oriented Programming) Lab#2 obt=s1+s2+s3+s4+s5; cout<<”Your Obtained Marks are”<<obt<<endl; per=(obt*100)/tot; cout<<”Your Percentage is=”<<per<<endl; avg=obt/5; cout<<”Your Average is=”<<avg<<endl; getche(); }
  • 7. Quaid-e-Awam University of Engineering Science & Technology Nawabshah OOP(Object Oriented Programming) Lab#2 Program#6 #include<iostream> #include<conio.h> Using namespace std; int main() { int a=10; cout<<a<<endl; a=a+a; cout<<a<<endl; a--; cout<<a<<endl; getche(); }
  • 8. Quaid-e-Awam University of Engineering Science & Technology Nawabshah OOP(Object Oriented Programming) Lab#2 Program#7 #include<iostream> #include<conio.h> Using namespace std; int main() { cout<<”CCCCCCCCCC”<<”t++t”<<”t++”<<endl; cout<<”CCt”<<”t++t”<<”t++”<<endl; cout<<”CCt” ++++++++++++++”<<” ++++++++++++++”<<endl; cout<<”CCt” ++++++++++++++”<<” ++++++++++++++”<<endl; cout<<”CCt”<<”t++t”<<”t++”<<endl; cout<<”CCCCCCCCCC”<<”t++t”<<”t++”<<endl; getche(); }