SlideShare a Scribd company logo
PROGRAMMING OF TRUBO C++ LANGUAGE
Program No:1 (Addition of Two Numbers)
# include<iostream.h>
# include<conio.h>
Void main (void)
{
Clrscr () ;
Int a,b,c ;
a=10;
b=20;
C= a+b
Cout<<c;
getch ();
}
Program No:2 (Subtraction of Two no’s)
# include <iostream.h>
# include <conio.h>
Void main (void)
{
Int a,b,c ;
Clrscr();
Cout<< “subtraction of two values “ <<endl<<endl;
Cout<<”enter the value for a” <<endl;
Cin>>a;
Cout<<”enter the value for b”<<endl;
Cin>>b;
C=a-b;
Cout<<endl<<endl<<”subtraction”<<c ;
getch();
}
Program No: 3 (Cube)
# include <iostream.h>
# include<conio.h>
Void main (void)
{
Int r, cube ;
Clrscr () ;
Cout<<”enter the value for integer”<<endl ;
Cin>>r;
Cube = r*r*r ;
Cout<<endl<<endl<<”cube”<<cube;
getch () ;
}
Progam No:4 (Area of Circle)
# include <iostream.h>
# include <conio.h>
Void main (void)
{
Float pi ,r ,area ;
Clrscr ();
Cout<<”enter the value for radius”<<endl ;
Cin>>r;
Area = Pi*(r*r) ;
cout<<end<<endl<<”area”<<area ;
getch () ;
}
Program No:5 (circumference of circle)
# include <iostream.h>
# include <conio.h>
Void main (void)
{
Float pi,r, circumference ;
Clrscr () ;
Pi = 3.14;
Cout<<”enter the value of radius”<<endl ;
Cin>>r ;
Circumference = 2*(pi)*(r);
Cout<<endl<<endl<<”circumference= ”<<circum…;
getch () ;
}
Program No:6 (Area of Triangle)
# include <iostream.h>
# include <conio.h>
Void main (void)
{
Float base, height ,triangle ;
Clrscr () ;
Count<< ”enter the value of base”<<endl;
Cin>>base;
Cout<< “enter the value of the height “<<endl;
Cin>>height;
Triangle = 0.5*(base*height);
Cout<<endl<<endl<<”triangle= ”<<triangle;
getch () ;
}
Program No:7 (Constant Number)
#include <iostream.h>
# include <conio.h>
Void main (void)
{
Clrscr () ;
Const int a= 20 ;
Int b=10, c ;
b=b+1;
c=a+b;
cout<<c;
getch () ;
}
Program No: 8 (For Loop)
# include <iostream.h>
# include <conio.h>
Void main (void)
{
Clrscr () ;
Int a ;
Cout <<”Enter any number, and will generate its table”<<endl;
Cin>>a;
Cout <<”upto which extent table must be generated “<<endl;
Cin>> = z;
Cout <<endl;
for ( int i=1 ; i<=z ; i++ )
cout <<a<< ”*” <<i<< ”=” << a*1 <<endl;
getch () ;
}
Program No: 9 ( Average )
# include<constream.h>
Void main (void)
Clrscr () ;
Const int n=5;
Int sum=o;
Int x[ n];
Cout<<”marks of five subjects ”;
Cout<<endl;
for (int i=o; i<n; i++)
{
Cin>>x[i];
}
Int average=sum/n;
Cout<<endl<<”average 15 ”;
Cout<<average;
getch();
}
Program No: 10 ( Factorial )
# include<constream.h>
Void main (void)
{
Clrscr () ;
int num , fact=1;
Cout<<”enter the number to calculate its factorial:”;
Cin>>num;
for (int i=1 ; i<=num ; i++)
fact += i ;
Cout<<num<<”!=”<<fact;
getch () ;
}
Program No: 11 ( Array )
# include <iostream.h>
# include <conio.h>
Void main (void)
{
Clrscr () ;
Int x[10];
X[0]=2;
X[1]=3;
X[2]=4;
Cout<<x[0];
getch () ;
}
Program No: 12 (Introducton To While Loop)
# iunclude <iostream.h>
# include <conio.h>
Void main (void)
{
Clrscr () ;
int a ;
a=1;
While(a<10)
{
Cout<<a<<endl;
a++;
}
getch () ;
}
getch();
}
Program No: 13 (Making a sequence Using while loop)
# include <iostream.h>
# include <conio.h>
Void main (void)
Clrscr () ;
Long limit,next,last;
Limit = 1000;
Next=0;
Last=1;
While(last<limit)
{
Cout<<last<<” “endl;
Long sum = next+last;
Next = last;
Last = sum;
}
getch () ;
}
Program No: 14 ( Temperature conversion )
# include <iostream.h>
# include <conio.h>
Void main(void)
{
Clrscr();
Int choice;
Float ctemp,ftemp;
Cout<<”1.celsius to Fahrenheit”<<endl;
Cout<<”2.fahrenheit to Celsius”<<endl;
Cout<<”choose between 1&2:”<<endl;
Cin>>choice;
If(choice==1)
{
Cout<<”Enter the temperatre incelsius:”<<endl;
Cin>>ctemp;
Ftemp=(1.8*ctemp)+32;
Cout<< “temperatre in Fahrenheit=”<<ftemp<<endl;
}
Else
{
Cout<<”Enter the temperatre inFahrenheit : ”<<endl;
Cin>>ftemp;
C temp=(ftemp-32)*0.55;
Cout<<”temperature incelscius= “<<ctemp<<endl;
}
getch () ;
}
Program No: 15 ( Pre Increment )
# include <iostrem.h>
# include <conio.h>
Void main (void)
{
Clrscr () ;
Int a;
a=10;
a=a++;
cout<<a;
getch () ;
}
Program No : 16 ( Display cube series 1 to 10 )
# include < constream.h >
# include < iomanip.h >
Void main () ;
int a ;
for ( a=1 ; a<=10 ; a=a+1 )
{
Cout << set w (50)<<a;
int cube = a*a*a;
cout<<setw(6)<<cube<<endl; }
getch () ; }
Program No: 17 ( For Pattern )
# include <iostream.h>
# include <conio.h>
Void main (void)
{
Clrscr () ;
for (int i = I ; i<=5 ; i++)
{
for (int j=1 ; j<=I ; j++)
{
Cout<< ”*” ;
}
Cout<<endl ;
}
getch () ;
}
Program No: 18 ( for loop repetition of Name)
# include <iostream.h>
# include <conio.h>
Void main (void)
{
Clrscr () ;
Int a;
a=1;
For (a=1 ; a<=10 ; a++)
Cout<<”zohaib”<<endl;
getch () ;
}
Program No: 19 ( Table of Two by for loop )
# include <iostream.h>
# include <conio.h>
Void main (void)
{
Clrscr () ;
Int a;
a=1;
for (a=1 ; a<=10 ; a++)
cout<<2<< ”*” <<a<< ”=” << a*2 <<endl;
getch () ;
}
Program No : 20 ( Logical )
# include <iostream.h>
# include <conio.h>
Void main (void)
{
Clrscr () ;
Int a = 10 , b = 25;
Cout <<”a>b is ”<< (a>b )<<endl;
Cout <<”a<b is “<<(a<b)<<endl;
Cout <<”a==b is ”<<(a==b)<<endl;
Cout <<”a>=b is ”<<(a>=b)<<endl;
Cout <<”a<=b is ”<<(a<=b)<<endl;
Cout <<”a!=b is ”<<(a!=b)<<endl;
getch () ;
}
Program No: 21 ( Post Increment)
# include <iostream.h>
# include <conio.h>
Void main (void)
{
Clrscr () ;
Int a;
a = 12;
cout <<a++<<endl;
cout <<++a;
getch () ;
}
Program No: 22 ( Do While )
# include <iostream.h>
# include <conio.h>
Void main ( void )
{
float dividend,divisor;
char ch;
do
{
Cout<<”Enter Dividend”<<endl;
Cin>>dividend;
Cout<<”Enter divisor”<<endl;
Cin>>divisor;
Cout<<”QUOTIENT IS = “<<dividend/divisor<<endl;
Cout<<”DO YOU WANT TO PERFORM ANOTHER (Y/N)?”;
Cin>>ch;
}
While (ch!=’n’);
getch () ;
}
Program No:23 (Conditional Operator )
# include <iostream.h>
# include <conio.h>
Void main (void)
{
int a,b,c;
clrscr () ;
cout<<”Enter value of a:” ;
cin >> a;
cout<<”Enter the value of b:”;
cin>>b;
c= a>b?a:b;
cout<<a<<”is greatest”;
getch ();
}
Program No: 24 ( Power Dissipation )
# include <iostream.h>
# include <conio.h>
Void main (void)
{ clrscr ();
Float V,I,R,P;
Cout<<”Enter the voltage across the resistor :”<<endl;
Cin>>V;
Cout<<”Enter the current through resistor :”<<endl;
Cin>>I;
R=V/I;
P=(I*I)*R;
Cout<<”The power dissipation is :”<<P<<”watts”<<endl;
If (P>100)
Cout<<”Alert! There is too much dissipation”;
getch();
}
Program No: 25 ( Addition of square,cube,fourth )
# include <iostream.h>
# include <conio.h>
int square;
int cube;
int fourth;
void main (void)
{
Clrscr();
int x,y,z,X1,Y1,Z1,fX;
cout<<”Enter the value of X”;
cin>>x;
cout<<”Enter the value of Y”;
cin>>y;
cout<<endl<<”Enter the value of Z”;
cin>>z;
X1= square;
Y1=cube;
Z1=fourth;
Cout<<”Result of f(x) is”<<fx;
getch();
}
Program No: 26 (Parametric Area)
# include <iostream.h>
# include <conio.h>
Void main (void)
{
Clrscr();
int L;
int W;
int A;
int P;
float T;
cout<<”length=”;
cin>>L;
cout<<”width=”;
cin>>w;
A=l*W;
Cout<<”Area=”<<A;
P=(2*l)+(2*W);
Cout<<”/n param=”<<P;
T=0.5*(L*W)’
Cout<<”/n Area Tri=”<<T;
getch();
}
C++ assignment

More Related Content

What's hot

Pratik Bakane C++
Pratik Bakane C++Pratik Bakane C++
Pratik Bakane C++
pratikbakane
 
C- Programs - Harsh
C- Programs - HarshC- Programs - Harsh
C- Programs - Harsh
Harsh Sharma
 
c++ project on restaurant billing
c++ project on restaurant billing c++ project on restaurant billing
c++ project on restaurant billing
Swakriti Rathore
 
Computer science Investigatory Project Class 12 C++
Computer science Investigatory Project Class 12 C++Computer science Investigatory Project Class 12 C++
Computer science Investigatory Project Class 12 C++
Rushil Aggarwal
 
Pratik Bakane C++
Pratik Bakane C++Pratik Bakane C++
Pratik Bakane C++
pratikbakane
 
1 borland c++ 5.02 by aramse
1   borland c++ 5.02 by aramse1   borland c++ 5.02 by aramse
1 borland c++ 5.02 by aramseAram SE
 
Computer science project work
Computer science project workComputer science project work
Computer science project work
rahulchamp2345
 
Travel management
Travel managementTravel management
Travel management1Parimal2
 
C++ file
C++ fileC++ file
Assignement of programming & problem solving ass.(3)
Assignement of programming & problem solving ass.(3)Assignement of programming & problem solving ass.(3)
Assignement of programming & problem solving ass.(3)
Syed Umair
 
CBSE Computer Project for Class 12 ( C++)
CBSE Computer Project for Class 12 ( C++)CBSE Computer Project for Class 12 ( C++)
CBSE Computer Project for Class 12 ( C++)
Karan Bora
 
c++ program for Railway reservation
c++ program for Railway reservationc++ program for Railway reservation
c++ program for Railway reservationSwarup Kumar Boro
 
Pads lab manual final
Pads lab manual finalPads lab manual final
Pads lab manual final
AhalyaR
 
basic programs in C++
basic programs in C++ basic programs in C++
basic programs in C++ Arun Nair
 
C++ Programming - 3rd Study
C++ Programming - 3rd StudyC++ Programming - 3rd Study
C++ Programming - 3rd Study
Chris Ohk
 
programming in C++ report
programming in C++ reportprogramming in C++ report
programming in C++ report
vikram mahendra
 
Practical File of C Language
Practical File of C LanguagePractical File of C Language
Practical File of C Language
RAJWANT KAUR
 

What's hot (20)

Pratik Bakane C++
Pratik Bakane C++Pratik Bakane C++
Pratik Bakane C++
 
C- Programs - Harsh
C- Programs - HarshC- Programs - Harsh
C- Programs - Harsh
 
c++ project on restaurant billing
c++ project on restaurant billing c++ project on restaurant billing
c++ project on restaurant billing
 
Computer science Investigatory Project Class 12 C++
Computer science Investigatory Project Class 12 C++Computer science Investigatory Project Class 12 C++
Computer science Investigatory Project Class 12 C++
 
Pratik Bakane C++
Pratik Bakane C++Pratik Bakane C++
Pratik Bakane C++
 
1 borland c++ 5.02 by aramse
1   borland c++ 5.02 by aramse1   borland c++ 5.02 by aramse
1 borland c++ 5.02 by aramse
 
Computer science project work
Computer science project workComputer science project work
Computer science project work
 
Travel management
Travel managementTravel management
Travel management
 
งานนำเสนอ อาจารย์ลาวัลย์
งานนำเสนอ อาจารย์ลาวัลย์งานนำเสนอ อาจารย์ลาวัลย์
งานนำเสนอ อาจารย์ลาวัลย์
 
C++ file
C++ fileC++ file
C++ file
 
Lab loop
Lab loopLab loop
Lab loop
 
Assignement of programming & problem solving ass.(3)
Assignement of programming & problem solving ass.(3)Assignement of programming & problem solving ass.(3)
Assignement of programming & problem solving ass.(3)
 
CBSE Computer Project for Class 12 ( C++)
CBSE Computer Project for Class 12 ( C++)CBSE Computer Project for Class 12 ( C++)
CBSE Computer Project for Class 12 ( C++)
 
c++ program for Railway reservation
c++ program for Railway reservationc++ program for Railway reservation
c++ program for Railway reservation
 
Pads lab manual final
Pads lab manual finalPads lab manual final
Pads lab manual final
 
basic programs in C++
basic programs in C++ basic programs in C++
basic programs in C++
 
C++ Programming - 3rd Study
C++ Programming - 3rd StudyC++ Programming - 3rd Study
C++ Programming - 3rd Study
 
programming in C++ report
programming in C++ reportprogramming in C++ report
programming in C++ report
 
C++ file
C++ fileC++ file
C++ file
 
Practical File of C Language
Practical File of C LanguagePractical File of C Language
Practical File of C Language
 

Viewers also liked

Celula animal
Celula animalCelula animal
Celula animal
marvin montejo
 
Industri vaksin
Industri vaksinIndustri vaksin
Industri vaksin
Irwan Effendi
 
Computación Grafica jairo andres
Computación Grafica jairo andresComputación Grafica jairo andres
Computación Grafica jairo andres
JAIRO ANDRES RINCON SANCHEZ
 
Nuevo presentación de microsoft power point
Nuevo presentación de microsoft power pointNuevo presentación de microsoft power point
Nuevo presentación de microsoft power point
María Camila Herrera Millán
 
Competencias de innovación y creatividad ponencia mesa 3
Competencias de innovación y creatividad ponencia mesa 3Competencias de innovación y creatividad ponencia mesa 3
Competencias de innovación y creatividad ponencia mesa 3
Ildebranda Lopez
 
Ms. Meenu Goswami , Principal Bal bharati public school
Ms. Meenu Goswami , Principal  Bal bharati public schoolMs. Meenu Goswami , Principal  Bal bharati public school
Ms. Meenu Goswami , Principal Bal bharati public school
Meenu Goswami
 
Bal bharati public school Principal, Ms. Meenu Goswami
Bal bharati public school  Principal, Ms. Meenu GoswamiBal bharati public school  Principal, Ms. Meenu Goswami
Bal bharati public school Principal, Ms. Meenu Goswami
Meenu Goswami
 
Diseño electronico
Diseño electronicoDiseño electronico
Diseño electronico
Nataytepha
 
IGLOBE ACADEMIC PORTALs PRESENTATION AUDIO LOOP
IGLOBE ACADEMIC PORTALs PRESENTATION AUDIO LOOPIGLOBE ACADEMIC PORTALs PRESENTATION AUDIO LOOP
IGLOBE ACADEMIC PORTALs PRESENTATION AUDIO LOOPKindzeka Nestor
 
FORMATURA
FORMATURAFORMATURA
Tice
TiceTice
Tyfonen haiyan
Tyfonen haiyanTyfonen haiyan
Tyfonen haiyan
mapean
 

Viewers also liked (13)

Celula animal
Celula animalCelula animal
Celula animal
 
2015resume
2015resume2015resume
2015resume
 
Industri vaksin
Industri vaksinIndustri vaksin
Industri vaksin
 
Computación Grafica jairo andres
Computación Grafica jairo andresComputación Grafica jairo andres
Computación Grafica jairo andres
 
Nuevo presentación de microsoft power point
Nuevo presentación de microsoft power pointNuevo presentación de microsoft power point
Nuevo presentación de microsoft power point
 
Competencias de innovación y creatividad ponencia mesa 3
Competencias de innovación y creatividad ponencia mesa 3Competencias de innovación y creatividad ponencia mesa 3
Competencias de innovación y creatividad ponencia mesa 3
 
Ms. Meenu Goswami , Principal Bal bharati public school
Ms. Meenu Goswami , Principal  Bal bharati public schoolMs. Meenu Goswami , Principal  Bal bharati public school
Ms. Meenu Goswami , Principal Bal bharati public school
 
Bal bharati public school Principal, Ms. Meenu Goswami
Bal bharati public school  Principal, Ms. Meenu GoswamiBal bharati public school  Principal, Ms. Meenu Goswami
Bal bharati public school Principal, Ms. Meenu Goswami
 
Diseño electronico
Diseño electronicoDiseño electronico
Diseño electronico
 
IGLOBE ACADEMIC PORTALs PRESENTATION AUDIO LOOP
IGLOBE ACADEMIC PORTALs PRESENTATION AUDIO LOOPIGLOBE ACADEMIC PORTALs PRESENTATION AUDIO LOOP
IGLOBE ACADEMIC PORTALs PRESENTATION AUDIO LOOP
 
FORMATURA
FORMATURAFORMATURA
FORMATURA
 
Tice
TiceTice
Tice
 
Tyfonen haiyan
Tyfonen haiyanTyfonen haiyan
Tyfonen haiyan
 

Similar to C++ assignment

54602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee0108310154602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee01083101
premrings
 
Oops practical file
Oops practical fileOops practical file
Oops practical fileAnkit Dixit
 
Code for program to draw a circle using mid point circle algorithm in c
Code for program to draw a circle using mid point circle algorithm in cCode for program to draw a circle using mid point circle algorithm in c
Code for program to draw a circle using mid point circle algorithm in c
Ossa2015
 
C++ Programming - 1st Study
C++ Programming - 1st StudyC++ Programming - 1st Study
C++ Programming - 1st Study
Chris Ohk
 
2014 computer science_question_paper
2014 computer science_question_paper2014 computer science_question_paper
2014 computer science_question_paper
vandna123
 
'C' language notes (a.p)
'C' language notes (a.p)'C' language notes (a.p)
'C' language notes (a.p)
Ashishchinu
 
Assignment no 5
Assignment no 5Assignment no 5
Assignment no 5
nancydrews
 
C++ practical
C++ practicalC++ practical
C++ practical
Rahul juneja
 
C++ TUTORIAL 8
C++ TUTORIAL 8C++ TUTORIAL 8
C++ TUTORIAL 8
Farhan Ab Rahman
 
Final DAA_prints.pdf
Final DAA_prints.pdfFinal DAA_prints.pdf
Final DAA_prints.pdf
Yashpatel821746
 
C++ Programming - 2nd Study
C++ Programming - 2nd StudyC++ Programming - 2nd Study
C++ Programming - 2nd Study
Chris Ohk
 
Cs pritical file
Cs pritical fileCs pritical file
Cs pritical file
Mitul Patel
 
Programming assignment 30 12-11
Programming assignment 30 12-11Programming assignment 30 12-11
Programming assignment 30 12-11
Bilal Maqbool ツ
 
Assignement of programming & problem solving
Assignement of programming & problem solvingAssignement of programming & problem solving
Assignement of programming & problem solving
Syed Umair
 
C questions
C questionsC questions
C questions
MD Rashid
 

Similar to C++ assignment (20)

54602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee0108310154602399 c-examples-51-to-108-programe-ee01083101
54602399 c-examples-51-to-108-programe-ee01083101
 
C++ file
C++ fileC++ file
C++ file
 
Oops practical file
Oops practical fileOops practical file
Oops practical file
 
Code for program to draw a circle using mid point circle algorithm in c
Code for program to draw a circle using mid point circle algorithm in cCode for program to draw a circle using mid point circle algorithm in c
Code for program to draw a circle using mid point circle algorithm in c
 
C++ Programming - 1st Study
C++ Programming - 1st StudyC++ Programming - 1st Study
C++ Programming - 1st Study
 
Qno 1 (d)
Qno 1 (d)Qno 1 (d)
Qno 1 (d)
 
2014 computer science_question_paper
2014 computer science_question_paper2014 computer science_question_paper
2014 computer science_question_paper
 
'C' language notes (a.p)
'C' language notes (a.p)'C' language notes (a.p)
'C' language notes (a.p)
 
Assignment no 5
Assignment no 5Assignment no 5
Assignment no 5
 
C++ practical
C++ practicalC++ practical
C++ practical
 
Include
IncludeInclude
Include
 
Cpp c++ 1
Cpp c++ 1Cpp c++ 1
Cpp c++ 1
 
C++ TUTORIAL 8
C++ TUTORIAL 8C++ TUTORIAL 8
C++ TUTORIAL 8
 
Final DAA_prints.pdf
Final DAA_prints.pdfFinal DAA_prints.pdf
Final DAA_prints.pdf
 
7720
77207720
7720
 
C++ Programming - 2nd Study
C++ Programming - 2nd StudyC++ Programming - 2nd Study
C++ Programming - 2nd Study
 
Cs pritical file
Cs pritical fileCs pritical file
Cs pritical file
 
Programming assignment 30 12-11
Programming assignment 30 12-11Programming assignment 30 12-11
Programming assignment 30 12-11
 
Assignement of programming & problem solving
Assignement of programming & problem solvingAssignement of programming & problem solving
Assignement of programming & problem solving
 
C questions
C questionsC questions
C questions
 

Recently uploaded

Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 

Recently uploaded (20)

Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 

C++ assignment

  • 1. PROGRAMMING OF TRUBO C++ LANGUAGE Program No:1 (Addition of Two Numbers) # include<iostream.h> # include<conio.h> Void main (void) { Clrscr () ; Int a,b,c ; a=10; b=20; C= a+b Cout<<c; getch (); }
  • 2. Program No:2 (Subtraction of Two no’s) # include <iostream.h> # include <conio.h> Void main (void) { Int a,b,c ; Clrscr(); Cout<< “subtraction of two values “ <<endl<<endl; Cout<<”enter the value for a” <<endl; Cin>>a; Cout<<”enter the value for b”<<endl; Cin>>b; C=a-b; Cout<<endl<<endl<<”subtraction”<<c ; getch(); }
  • 3. Program No: 3 (Cube) # include <iostream.h> # include<conio.h> Void main (void) { Int r, cube ; Clrscr () ; Cout<<”enter the value for integer”<<endl ; Cin>>r; Cube = r*r*r ; Cout<<endl<<endl<<”cube”<<cube; getch () ; }
  • 4. Progam No:4 (Area of Circle) # include <iostream.h> # include <conio.h> Void main (void) { Float pi ,r ,area ; Clrscr (); Cout<<”enter the value for radius”<<endl ; Cin>>r; Area = Pi*(r*r) ; cout<<end<<endl<<”area”<<area ; getch () ; }
  • 5. Program No:5 (circumference of circle) # include <iostream.h> # include <conio.h> Void main (void) { Float pi,r, circumference ; Clrscr () ; Pi = 3.14; Cout<<”enter the value of radius”<<endl ; Cin>>r ; Circumference = 2*(pi)*(r); Cout<<endl<<endl<<”circumference= ”<<circum…; getch () ; }
  • 6. Program No:6 (Area of Triangle) # include <iostream.h> # include <conio.h> Void main (void) { Float base, height ,triangle ; Clrscr () ; Count<< ”enter the value of base”<<endl; Cin>>base; Cout<< “enter the value of the height “<<endl; Cin>>height; Triangle = 0.5*(base*height); Cout<<endl<<endl<<”triangle= ”<<triangle; getch () ; }
  • 7. Program No:7 (Constant Number) #include <iostream.h> # include <conio.h> Void main (void) { Clrscr () ; Const int a= 20 ; Int b=10, c ; b=b+1; c=a+b; cout<<c; getch () ; }
  • 8. Program No: 8 (For Loop) # include <iostream.h> # include <conio.h> Void main (void) { Clrscr () ; Int a ; Cout <<”Enter any number, and will generate its table”<<endl; Cin>>a; Cout <<”upto which extent table must be generated “<<endl; Cin>> = z; Cout <<endl; for ( int i=1 ; i<=z ; i++ ) cout <<a<< ”*” <<i<< ”=” << a*1 <<endl; getch () ; }
  • 9. Program No: 9 ( Average ) # include<constream.h> Void main (void) Clrscr () ; Const int n=5; Int sum=o; Int x[ n]; Cout<<”marks of five subjects ”; Cout<<endl; for (int i=o; i<n; i++) { Cin>>x[i]; } Int average=sum/n; Cout<<endl<<”average 15 ”; Cout<<average; getch(); }
  • 10. Program No: 10 ( Factorial ) # include<constream.h> Void main (void) { Clrscr () ; int num , fact=1; Cout<<”enter the number to calculate its factorial:”; Cin>>num; for (int i=1 ; i<=num ; i++) fact += i ; Cout<<num<<”!=”<<fact; getch () ; }
  • 11. Program No: 11 ( Array ) # include <iostream.h> # include <conio.h> Void main (void) { Clrscr () ; Int x[10]; X[0]=2; X[1]=3; X[2]=4; Cout<<x[0]; getch () ; }
  • 12. Program No: 12 (Introducton To While Loop) # iunclude <iostream.h> # include <conio.h> Void main (void) { Clrscr () ; int a ; a=1; While(a<10) { Cout<<a<<endl; a++; } getch () ; } getch(); }
  • 13. Program No: 13 (Making a sequence Using while loop) # include <iostream.h> # include <conio.h> Void main (void) Clrscr () ; Long limit,next,last; Limit = 1000; Next=0; Last=1; While(last<limit) { Cout<<last<<” “endl; Long sum = next+last; Next = last; Last = sum; } getch () ; }
  • 14. Program No: 14 ( Temperature conversion ) # include <iostream.h> # include <conio.h> Void main(void) { Clrscr(); Int choice; Float ctemp,ftemp; Cout<<”1.celsius to Fahrenheit”<<endl; Cout<<”2.fahrenheit to Celsius”<<endl; Cout<<”choose between 1&2:”<<endl; Cin>>choice; If(choice==1) { Cout<<”Enter the temperatre incelsius:”<<endl; Cin>>ctemp; Ftemp=(1.8*ctemp)+32; Cout<< “temperatre in Fahrenheit=”<<ftemp<<endl; } Else { Cout<<”Enter the temperatre inFahrenheit : ”<<endl; Cin>>ftemp; C temp=(ftemp-32)*0.55; Cout<<”temperature incelscius= “<<ctemp<<endl; } getch () ; }
  • 15. Program No: 15 ( Pre Increment ) # include <iostrem.h> # include <conio.h> Void main (void) { Clrscr () ; Int a; a=10; a=a++; cout<<a; getch () ; }
  • 16. Program No : 16 ( Display cube series 1 to 10 ) # include < constream.h > # include < iomanip.h > Void main () ; int a ; for ( a=1 ; a<=10 ; a=a+1 ) { Cout << set w (50)<<a; int cube = a*a*a; cout<<setw(6)<<cube<<endl; } getch () ; }
  • 17. Program No: 17 ( For Pattern ) # include <iostream.h> # include <conio.h> Void main (void) { Clrscr () ; for (int i = I ; i<=5 ; i++) { for (int j=1 ; j<=I ; j++) { Cout<< ”*” ; } Cout<<endl ; } getch () ; }
  • 18. Program No: 18 ( for loop repetition of Name) # include <iostream.h> # include <conio.h> Void main (void) { Clrscr () ; Int a; a=1; For (a=1 ; a<=10 ; a++) Cout<<”zohaib”<<endl; getch () ; }
  • 19. Program No: 19 ( Table of Two by for loop ) # include <iostream.h> # include <conio.h> Void main (void) { Clrscr () ; Int a; a=1; for (a=1 ; a<=10 ; a++) cout<<2<< ”*” <<a<< ”=” << a*2 <<endl; getch () ; }
  • 20. Program No : 20 ( Logical ) # include <iostream.h> # include <conio.h> Void main (void) { Clrscr () ; Int a = 10 , b = 25; Cout <<”a>b is ”<< (a>b )<<endl; Cout <<”a<b is “<<(a<b)<<endl; Cout <<”a==b is ”<<(a==b)<<endl; Cout <<”a>=b is ”<<(a>=b)<<endl; Cout <<”a<=b is ”<<(a<=b)<<endl; Cout <<”a!=b is ”<<(a!=b)<<endl; getch () ; }
  • 21. Program No: 21 ( Post Increment) # include <iostream.h> # include <conio.h> Void main (void) { Clrscr () ; Int a; a = 12; cout <<a++<<endl; cout <<++a; getch () ; }
  • 22. Program No: 22 ( Do While ) # include <iostream.h> # include <conio.h> Void main ( void ) { float dividend,divisor; char ch; do { Cout<<”Enter Dividend”<<endl; Cin>>dividend; Cout<<”Enter divisor”<<endl; Cin>>divisor; Cout<<”QUOTIENT IS = “<<dividend/divisor<<endl; Cout<<”DO YOU WANT TO PERFORM ANOTHER (Y/N)?”; Cin>>ch; } While (ch!=’n’); getch () ; }
  • 23. Program No:23 (Conditional Operator ) # include <iostream.h> # include <conio.h> Void main (void) { int a,b,c; clrscr () ; cout<<”Enter value of a:” ; cin >> a; cout<<”Enter the value of b:”; cin>>b; c= a>b?a:b; cout<<a<<”is greatest”; getch (); }
  • 24. Program No: 24 ( Power Dissipation ) # include <iostream.h> # include <conio.h> Void main (void) { clrscr (); Float V,I,R,P; Cout<<”Enter the voltage across the resistor :”<<endl; Cin>>V; Cout<<”Enter the current through resistor :”<<endl; Cin>>I; R=V/I; P=(I*I)*R; Cout<<”The power dissipation is :”<<P<<”watts”<<endl; If (P>100) Cout<<”Alert! There is too much dissipation”; getch(); }
  • 25. Program No: 25 ( Addition of square,cube,fourth ) # include <iostream.h> # include <conio.h> int square; int cube; int fourth; void main (void) { Clrscr(); int x,y,z,X1,Y1,Z1,fX; cout<<”Enter the value of X”; cin>>x; cout<<”Enter the value of Y”; cin>>y; cout<<endl<<”Enter the value of Z”; cin>>z; X1= square; Y1=cube; Z1=fourth; Cout<<”Result of f(x) is”<<fx; getch(); }
  • 26. Program No: 26 (Parametric Area) # include <iostream.h> # include <conio.h> Void main (void) { Clrscr(); int L; int W; int A; int P; float T; cout<<”length=”; cin>>L; cout<<”width=”; cin>>w; A=l*W; Cout<<”Area=”<<A; P=(2*l)+(2*W); Cout<<”/n param=”<<P; T=0.5*(L*W)’ Cout<<”/n Area Tri=”<<T; getch(); }