SlideShare une entreprise Scribd logo
1  sur  20
1 
// 1. Program to implement arithmetic operators 
#include<iostream.h> 
#include<conio.h> 
void main() 
{ 
clrscr(); 
int a,b,sum,sub,mul,div; 
cout<<"nenter the numbers : "; 
cin>>a>>b; 
sum=a+b; 
sub=a-b; 
mul=a*b; 
div=a/b; 
cout<<"nSum:"<<sum; 
cout<<"nSubtraction:"<<sub; 
cout<<"nMultipication:"<<mul; 
cout<<"nDivision:"<<div; 
getch(); 
}
2 
Output :
3 
// 2. Program to calculate simple interest 
#include<iostream.h> 
#include<conio.h> 
void main() 
{ 
clrscr(); 
int principle,rate,time,si; 
cout<<"nEnter the principle : "; 
cin>>principle; 
cout<<"nEnter the rate : "; 
cin>>rate; 
cout<<"nEnter the time :"; 
cout<<interest; 
si=(principle*rate*time)/100; 
cout<<"nSimple Interest :"<<si; 
getch(); 
}
4 
Output :
// 3. Program to implement increment and decrement operators 
5 
#include<iostream.h> 
#include<conio.h> 
void main() 
{ 
clrscr(); 
int x=5,y=5; 
cout<<x++; 
cout<<"n"; 
cout<<++x; 
cout<<"n"; 
cout<<y++; 
cout<<"n"; 
cout<<++y; 
getch(); 
}
6 
Output :
7 
// 4. Program to implement if-else statements 
#include<iostream.h> 
#include<conio.h> 
void main() 
{ 
clrscr(); 
int year; 
cout<<"nEnter the year:"; 
cin>>year; 
if(year%4==0) 
cout<<"nIt is a leap year"; 
else 
cout<<"Not a leap year"; 
getch(); 
}
8 
Output :
// 5. Program to implement if-else if ladder statement 
9 
#include<iostream.h> 
#include<conio.h> 
void main() 
{ 
clrscr(); 
float sal; 
float tax; 
cout<<"nEnter the salary : "; 
cin>>sal; 
if(sal>=9000) 
tax=sal*0.4; 
else if((sal>=7500)&&(sal<8999)) 
tax=sal*0.3; 
else 
tax=sal*0.2; 
cout<<"Tax:"<<tax; 
getch(); 
}
10 
Output :
// 6. Program to implement switch case statement 
11 
#include<iostream.h> 
#include<conio.h> 
void main() 
{ 
clrscr(); 
int ch; 
cout<<"nEnter your choice : "; 
cin>>ch; 
switch(ch) 
{ 
case 1 : cout<<"nCase 1 : Good Morning"; 
break; 
case 2 : cout<<"nCase 2 : Good Afternoon"; 
break; 
case 3 : cout<<"nCase 3 : Good Evening"; 
break; 
case 4 : cout<<"nCase 4 : Good Night"; 
break; 
deafult: cout<<"nWrong choice"; 
} 
getch(); 
}
12 
Output :
// 7. Program to implement while loop and it computes a power of b 
13 
#include<iostream.h> 
#include<conio.h> 
void main() 
{ 
clrscr(); 
float a; 
int b; 
float pow; 
cout<<"nEnter the values : "; 
cin>>a>>b; 
pow=1.0; 
while(b>=1) 
{ 
pow=pow*a; 
b--; 
} 
cout<<"Power : "<<pow; 
getch(); 
}
14 
Output :
// 8. Program to implement do while and it computes the factorial of a number 
15 
#include<iostream.h> 
#include<conio.h> 
void main() 
{ 
clrscr(); 
int num,fact=1; 
cout<<"nEnter the numnber : "; 
cin>>num; 
do 
{ 
fact=fact*num; 
num--; 
} 
while(num!=0); 
cout<<"nFactorial :"<<fact; 
getch(); 
}
16 
Output :
17 
// 9. Program to display an array 
#include<iostream.h> 
#include<conio.h> 
void main() 
{ 
clrscr(); 
int a[5],i; 
cout<<"nEnter the elements in an array :n"; 
for(i=0;i<5;i++) 
{ 
cin>>a[i]; 
} 
cout<<"nDisplayed array : n"; 
for(i=0;i<5;i++) 
{ 
cout<<"n"<<a[i]; 
} 
getch(); 
}
18 
Output :
// 10. Program to display multiples of a number using for loop 
19 
#include<iostream.h> 
#include<conio.h> 
void main() 
{ 
clrscr(); 
int i,num; 
cout<<"nEnter the number :"; 
cin>>num; 
cout<<"The multiples are :"; 
for(i=1;i<=10;i++) 
{ 
cout<<"n"<<num*i; 
} 
getch(); 
}
20 
Output :

Contenu connexe

Tendances

Promises, promises, and then observables
Promises, promises, and then observablesPromises, promises, and then observables
Promises, promises, and then observablesStefan Charsley
 
Kotlin Coroutines. Flow is coming
Kotlin Coroutines. Flow is comingKotlin Coroutines. Flow is coming
Kotlin Coroutines. Flow is comingKirill Rozov
 
Computer Science class 12
Computer Science  class 12Computer Science  class 12
Computer Science class 12Abhishek Sinha
 
C programming Lab 1
C programming Lab 1C programming Lab 1
C programming Lab 1Zaibi Gondal
 
c++ project on restaurant billing
c++ project on restaurant billing c++ project on restaurant billing
c++ project on restaurant billing Swakriti Rathore
 
Roadmap to Object Oriented Programming
Roadmap to Object Oriented ProgrammingRoadmap to Object Oriented Programming
Roadmap to Object Oriented Programmingssuser6fc8b1
 
Kotlin Coroutines in Practice @ KotlinConf 2018
Kotlin Coroutines in Practice @ KotlinConf 2018Kotlin Coroutines in Practice @ KotlinConf 2018
Kotlin Coroutines in Practice @ KotlinConf 2018Roman Elizarov
 
C++ 25 programs Class XII
C++ 25 programs Class XIIC++ 25 programs Class XII
C++ 25 programs Class XIISaurav Ranjan
 
Angular and The Case for RxJS
Angular and The Case for RxJSAngular and The Case for RxJS
Angular and The Case for RxJSSandi Barr
 
Utilizing kotlin flows in an android application
Utilizing kotlin flows in an android applicationUtilizing kotlin flows in an android application
Utilizing kotlin flows in an android applicationSeven Peaks Speaks
 
Introduction to Coroutines @ KotlinConf 2017
Introduction to Coroutines @ KotlinConf 2017Introduction to Coroutines @ KotlinConf 2017
Introduction to Coroutines @ KotlinConf 2017Roman Elizarov
 
Deep dive into Coroutines on JVM @ KotlinConf 2017
Deep dive into Coroutines on JVM @ KotlinConf 2017Deep dive into Coroutines on JVM @ KotlinConf 2017
Deep dive into Coroutines on JVM @ KotlinConf 2017Roman Elizarov
 
programming in C++ report
programming in C++ reportprogramming in C++ report
programming in C++ reportvikram mahendra
 
Bca sem 5 c# practical
Bca sem 5 c# practicalBca sem 5 c# practical
Bca sem 5 c# practicalHitesh Patel
 
Data Structures Using C Practical File
Data Structures Using C Practical File Data Structures Using C Practical File
Data Structures Using C Practical File Rahul Chugh
 
PHP para Adultos: Clean Code e Object Calisthenics
PHP para Adultos: Clean Code e Object CalisthenicsPHP para Adultos: Clean Code e Object Calisthenics
PHP para Adultos: Clean Code e Object CalisthenicsGuilherme Blanco
 
The solution manual of programming in ansi by Robin
The solution manual of programming in ansi by RobinThe solution manual of programming in ansi by Robin
The solution manual of programming in ansi by RobinShariful Haque Robin
 
Practical write a c program to reverse a given number
Practical write a c program to reverse a given numberPractical write a c program to reverse a given number
Practical write a c program to reverse a given numberMainak Sasmal
 

Tendances (20)

Promises, promises, and then observables
Promises, promises, and then observablesPromises, promises, and then observables
Promises, promises, and then observables
 
Kotlin Coroutines. Flow is coming
Kotlin Coroutines. Flow is comingKotlin Coroutines. Flow is coming
Kotlin Coroutines. Flow is coming
 
Computer Science class 12
Computer Science  class 12Computer Science  class 12
Computer Science class 12
 
C programming Lab 1
C programming Lab 1C programming Lab 1
C programming Lab 1
 
c++ project on restaurant billing
c++ project on restaurant billing c++ project on restaurant billing
c++ project on restaurant billing
 
Roadmap to Object Oriented Programming
Roadmap to Object Oriented ProgrammingRoadmap to Object Oriented Programming
Roadmap to Object Oriented Programming
 
Introduction to C++
Introduction to C++Introduction to C++
Introduction to C++
 
Kotlin Coroutines in Practice @ KotlinConf 2018
Kotlin Coroutines in Practice @ KotlinConf 2018Kotlin Coroutines in Practice @ KotlinConf 2018
Kotlin Coroutines in Practice @ KotlinConf 2018
 
C++ 25 programs Class XII
C++ 25 programs Class XIIC++ 25 programs Class XII
C++ 25 programs Class XII
 
Angular and The Case for RxJS
Angular and The Case for RxJSAngular and The Case for RxJS
Angular and The Case for RxJS
 
Utilizing kotlin flows in an android application
Utilizing kotlin flows in an android applicationUtilizing kotlin flows in an android application
Utilizing kotlin flows in an android application
 
Introduction to Coroutines @ KotlinConf 2017
Introduction to Coroutines @ KotlinConf 2017Introduction to Coroutines @ KotlinConf 2017
Introduction to Coroutines @ KotlinConf 2017
 
Deep dive into Coroutines on JVM @ KotlinConf 2017
Deep dive into Coroutines on JVM @ KotlinConf 2017Deep dive into Coroutines on JVM @ KotlinConf 2017
Deep dive into Coroutines on JVM @ KotlinConf 2017
 
programming in C++ report
programming in C++ reportprogramming in C++ report
programming in C++ report
 
Bca sem 5 c# practical
Bca sem 5 c# practicalBca sem 5 c# practical
Bca sem 5 c# practical
 
Data Structures Using C Practical File
Data Structures Using C Practical File Data Structures Using C Practical File
Data Structures Using C Practical File
 
PHP para Adultos: Clean Code e Object Calisthenics
PHP para Adultos: Clean Code e Object CalisthenicsPHP para Adultos: Clean Code e Object Calisthenics
PHP para Adultos: Clean Code e Object Calisthenics
 
C Programming Example
C Programming ExampleC Programming Example
C Programming Example
 
The solution manual of programming in ansi by Robin
The solution manual of programming in ansi by RobinThe solution manual of programming in ansi by Robin
The solution manual of programming in ansi by Robin
 
Practical write a c program to reverse a given number
Practical write a c program to reverse a given numberPractical write a c program to reverse a given number
Practical write a c program to reverse a given number
 

En vedette (11)

Write a program to print out all armstrong numbers between 1 and 500
Write a program to print out all armstrong numbers between 1 and 500Write a program to print out all armstrong numbers between 1 and 500
Write a program to print out all armstrong numbers between 1 and 500
 
Loops
LoopsLoops
Loops
 
Programs of C++
Programs of C++Programs of C++
Programs of C++
 
Doubly linklist
Doubly linklistDoubly linklist
Doubly linklist
 
Computer graphics programs in c++
Computer graphics programs in c++Computer graphics programs in c++
Computer graphics programs in c++
 
Pratik Bakane C++
Pratik Bakane C++Pratik Bakane C++
Pratik Bakane C++
 
Pratik Bakane C++
Pratik Bakane C++Pratik Bakane C++
Pratik Bakane C++
 
Pratik Bakane C++
Pratik Bakane C++Pratik Bakane C++
Pratik Bakane C++
 
C Programming
C ProgrammingC Programming
C Programming
 
Pratik Bakane C++
Pratik Bakane C++Pratik Bakane C++
Pratik Bakane C++
 
C++ programs
C++ programsC++ programs
C++ programs
 

Similaire à Basic Programs of C++

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
 
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-ee01083101premrings
 
Cs2312 OOPS LAB MANUAL
Cs2312 OOPS LAB MANUALCs2312 OOPS LAB MANUAL
Cs2312 OOPS LAB MANUALPrabhu D
 
C BASICS.pptx FFDJF/,DKFF90DF SDPJKFJ[DSSIFLHDSHF
C BASICS.pptx FFDJF/,DKFF90DF SDPJKFJ[DSSIFLHDSHFC BASICS.pptx FFDJF/,DKFF90DF SDPJKFJ[DSSIFLHDSHF
C BASICS.pptx FFDJF/,DKFF90DF SDPJKFJ[DSSIFLHDSHFAbcdR5
 
OOPS using C++
OOPS using C++OOPS using C++
OOPS using C++cpjcollege
 
Program to illustrate Switch, Goto and Exit statements.
Program to illustrate Switch, Goto and  Exit statements.Program to illustrate Switch, Goto and  Exit statements.
Program to illustrate Switch, Goto and Exit statements.harman kaur
 
'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 5nancydrews
 
filesHeap.h#ifndef HEAP_H#define HEAP_H#includ.docx
filesHeap.h#ifndef HEAP_H#define HEAP_H#includ.docxfilesHeap.h#ifndef HEAP_H#define HEAP_H#includ.docx
filesHeap.h#ifndef HEAP_H#define HEAP_H#includ.docxssuser454af01
 
Pads lab manual final
Pads lab manual finalPads lab manual final
Pads lab manual finalAhalyaR
 
Labsheet1 stud
Labsheet1 studLabsheet1 stud
Labsheet1 studrohassanie
 
How c program execute in c program
How c program execute in c program How c program execute in c program
How c program execute in c program Rumman Ansari
 

Similaire à Basic Programs of C++ (20)

C++ file
C++ fileC++ file
C++ file
 
Labsheet_3
Labsheet_3Labsheet_3
Labsheet_3
 
Bijender (1)
Bijender (1)Bijender (1)
Bijender (1)
 
Final DAA_prints.pdf
Final DAA_prints.pdfFinal DAA_prints.pdf
Final DAA_prints.pdf
 
7720
77207720
7720
 
C++ file
C++ fileC++ file
C++ 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)
 
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++ manual Report Full
C++ manual Report FullC++ manual Report Full
C++ manual Report Full
 
Cs2312 OOPS LAB MANUAL
Cs2312 OOPS LAB MANUALCs2312 OOPS LAB MANUAL
Cs2312 OOPS LAB MANUAL
 
C BASICS.pptx FFDJF/,DKFF90DF SDPJKFJ[DSSIFLHDSHF
C BASICS.pptx FFDJF/,DKFF90DF SDPJKFJ[DSSIFLHDSHFC BASICS.pptx FFDJF/,DKFF90DF SDPJKFJ[DSSIFLHDSHF
C BASICS.pptx FFDJF/,DKFF90DF SDPJKFJ[DSSIFLHDSHF
 
OOPS using C++
OOPS using C++OOPS using C++
OOPS using C++
 
C++ assignment
C++ assignmentC++ assignment
C++ assignment
 
Program to illustrate Switch, Goto and Exit statements.
Program to illustrate Switch, Goto and  Exit statements.Program to illustrate Switch, Goto and  Exit statements.
Program to illustrate Switch, Goto and Exit statements.
 
'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
 
filesHeap.h#ifndef HEAP_H#define HEAP_H#includ.docx
filesHeap.h#ifndef HEAP_H#define HEAP_H#includ.docxfilesHeap.h#ifndef HEAP_H#define HEAP_H#includ.docx
filesHeap.h#ifndef HEAP_H#define HEAP_H#includ.docx
 
Pads lab manual final
Pads lab manual finalPads lab manual final
Pads lab manual final
 
Labsheet1 stud
Labsheet1 studLabsheet1 stud
Labsheet1 stud
 
How c program execute in c program
How c program execute in c program How c program execute in c program
How c program execute in c program
 

Plus de Bharat Kalia

PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts Bharat Kalia
 
Groupware Technology Project Report
Groupware Technology Project ReportGroupware Technology Project Report
Groupware Technology Project ReportBharat Kalia
 
Extending Grids with Cloud Resource Management for Scientific Computing
Extending Grids with Cloud Resource Management for Scientific ComputingExtending Grids with Cloud Resource Management for Scientific Computing
Extending Grids with Cloud Resource Management for Scientific ComputingBharat Kalia
 
Introduction to Cloud Computing
Introduction to Cloud ComputingIntroduction to Cloud Computing
Introduction to Cloud ComputingBharat Kalia
 
Programming in C Basics
Programming in C BasicsProgramming in C Basics
Programming in C BasicsBharat Kalia
 
OLAP Basics and Fundamentals by Bharat Kalia
OLAP Basics and Fundamentals by Bharat Kalia OLAP Basics and Fundamentals by Bharat Kalia
OLAP Basics and Fundamentals by Bharat Kalia Bharat Kalia
 
Mingle box - Online Job seeking System
Mingle box - Online Job seeking SystemMingle box - Online Job seeking System
Mingle box - Online Job seeking SystemBharat Kalia
 
Project report of OCR Recognition
Project report of OCR RecognitionProject report of OCR Recognition
Project report of OCR RecognitionBharat Kalia
 
Object oriented programming Fundamental Concepts
Object oriented programming Fundamental ConceptsObject oriented programming Fundamental Concepts
Object oriented programming Fundamental ConceptsBharat Kalia
 
Introduction to C++
Introduction to C++ Introduction to C++
Introduction to C++ Bharat Kalia
 

Plus de Bharat Kalia (10)

PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts
 
Groupware Technology Project Report
Groupware Technology Project ReportGroupware Technology Project Report
Groupware Technology Project Report
 
Extending Grids with Cloud Resource Management for Scientific Computing
Extending Grids with Cloud Resource Management for Scientific ComputingExtending Grids with Cloud Resource Management for Scientific Computing
Extending Grids with Cloud Resource Management for Scientific Computing
 
Introduction to Cloud Computing
Introduction to Cloud ComputingIntroduction to Cloud Computing
Introduction to Cloud Computing
 
Programming in C Basics
Programming in C BasicsProgramming in C Basics
Programming in C Basics
 
OLAP Basics and Fundamentals by Bharat Kalia
OLAP Basics and Fundamentals by Bharat Kalia OLAP Basics and Fundamentals by Bharat Kalia
OLAP Basics and Fundamentals by Bharat Kalia
 
Mingle box - Online Job seeking System
Mingle box - Online Job seeking SystemMingle box - Online Job seeking System
Mingle box - Online Job seeking System
 
Project report of OCR Recognition
Project report of OCR RecognitionProject report of OCR Recognition
Project report of OCR Recognition
 
Object oriented programming Fundamental Concepts
Object oriented programming Fundamental ConceptsObject oriented programming Fundamental Concepts
Object oriented programming Fundamental Concepts
 
Introduction to C++
Introduction to C++ Introduction to C++
Introduction to C++
 

Dernier

Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 

Dernier (20)

Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 

Basic Programs of C++

  • 1. 1 // 1. Program to implement arithmetic operators #include<iostream.h> #include<conio.h> void main() { clrscr(); int a,b,sum,sub,mul,div; cout<<"nenter the numbers : "; cin>>a>>b; sum=a+b; sub=a-b; mul=a*b; div=a/b; cout<<"nSum:"<<sum; cout<<"nSubtraction:"<<sub; cout<<"nMultipication:"<<mul; cout<<"nDivision:"<<div; getch(); }
  • 3. 3 // 2. Program to calculate simple interest #include<iostream.h> #include<conio.h> void main() { clrscr(); int principle,rate,time,si; cout<<"nEnter the principle : "; cin>>principle; cout<<"nEnter the rate : "; cin>>rate; cout<<"nEnter the time :"; cout<<interest; si=(principle*rate*time)/100; cout<<"nSimple Interest :"<<si; getch(); }
  • 5. // 3. Program to implement increment and decrement operators 5 #include<iostream.h> #include<conio.h> void main() { clrscr(); int x=5,y=5; cout<<x++; cout<<"n"; cout<<++x; cout<<"n"; cout<<y++; cout<<"n"; cout<<++y; getch(); }
  • 7. 7 // 4. Program to implement if-else statements #include<iostream.h> #include<conio.h> void main() { clrscr(); int year; cout<<"nEnter the year:"; cin>>year; if(year%4==0) cout<<"nIt is a leap year"; else cout<<"Not a leap year"; getch(); }
  • 9. // 5. Program to implement if-else if ladder statement 9 #include<iostream.h> #include<conio.h> void main() { clrscr(); float sal; float tax; cout<<"nEnter the salary : "; cin>>sal; if(sal>=9000) tax=sal*0.4; else if((sal>=7500)&&(sal<8999)) tax=sal*0.3; else tax=sal*0.2; cout<<"Tax:"<<tax; getch(); }
  • 11. // 6. Program to implement switch case statement 11 #include<iostream.h> #include<conio.h> void main() { clrscr(); int ch; cout<<"nEnter your choice : "; cin>>ch; switch(ch) { case 1 : cout<<"nCase 1 : Good Morning"; break; case 2 : cout<<"nCase 2 : Good Afternoon"; break; case 3 : cout<<"nCase 3 : Good Evening"; break; case 4 : cout<<"nCase 4 : Good Night"; break; deafult: cout<<"nWrong choice"; } getch(); }
  • 13. // 7. Program to implement while loop and it computes a power of b 13 #include<iostream.h> #include<conio.h> void main() { clrscr(); float a; int b; float pow; cout<<"nEnter the values : "; cin>>a>>b; pow=1.0; while(b>=1) { pow=pow*a; b--; } cout<<"Power : "<<pow; getch(); }
  • 15. // 8. Program to implement do while and it computes the factorial of a number 15 #include<iostream.h> #include<conio.h> void main() { clrscr(); int num,fact=1; cout<<"nEnter the numnber : "; cin>>num; do { fact=fact*num; num--; } while(num!=0); cout<<"nFactorial :"<<fact; getch(); }
  • 17. 17 // 9. Program to display an array #include<iostream.h> #include<conio.h> void main() { clrscr(); int a[5],i; cout<<"nEnter the elements in an array :n"; for(i=0;i<5;i++) { cin>>a[i]; } cout<<"nDisplayed array : n"; for(i=0;i<5;i++) { cout<<"n"<<a[i]; } getch(); }
  • 19. // 10. Program to display multiples of a number using for loop 19 #include<iostream.h> #include<conio.h> void main() { clrscr(); int i,num; cout<<"nEnter the number :"; cin>>num; cout<<"The multiples are :"; for(i=1;i<=10;i++) { cout<<"n"<<num*i; } getch(); }