C++ Tutorials

C++ Project – Temperature Converter 0

C++ Project – Temperature Converter

Program 1 // Project for temprature convertor // Celsius to Fahrenheit and Fahrenheit to Celsius #include<iostream> #include<conio.h> #include<iostream> #define clrscr() system(“cls”) using namespace std; int main() { clrscr(); double tempconv,temp; int choice; do {...

C++ Project – Rock Paper Scissor Game 0

C++ Project – Rock Paper Scissor Game

Program 1 //Rock Paper Scissors Game #include<stdio.h> #include<conio.h> #include<iostream> #include<time.h> #define clrscr() system(“cls”) using namespace std; int main() { clrscr(); int compchoice,userchoice; while(1) { compchoice=rand()%3+1; cout<<“———Rock Paper Scissors Game————“; cout<<“\n 1. Rock \n 2....

C++ Project – Number Guessing Game 0

C++ Project – Number Guessing Game

Program 1 // Game for Guess Random Number #include<iostream> #include<conio.h> #include<stdlib.h> #include<time.h> #define clrscr() system(“cls”) using namespace std; int main() { clrscr(); srand(time(NULL)); int comp,user; int count=5; int i=0,choice; do { comp=rand()%100; while(count) {...

C++ Project – Coin Toss Game 0

C++ Project – Coin Toss Game

Program 1 // Coin Toss Game #include<iostream> #include<conio.h> #include<stdlib.h> #include<time.h> #define clrscr() system(“cls”) using namespace std; int main() { clrscr(); srand(time(0)); int coinchoice,userchoice; coinchoice=rand()%2+1; cout<<“\n————-Coin Toss Game————–“; cout<<“\n 1. Choose 1 for Head \n...

C++ Project – Simple Calculator 0

C++ Project – Simple Calculator

Program 1 //Simple Calculator Project using menu #include<iostream> #define clrscr() system(“cls”) using namespace std; class Calculator { public: int add(double a,double b) { return(a+b); } int sub(double a,double b) { return(a-b); } int multiply(double...

Function Overloading in C++ 0

Function Overloading in C++

Program 1 // Program for function overloading #include<iostream> #define clrscr() system(“cls”) using namespace std; double area(double ); double area(double,double); int main() { clrscr(); cout<<“\nArea of circle: “<<area(12.44); cout<<“\nArea of Rectangle: “<<area(12.4,6.8); return 0; }...

Pyramid Patterns in C++ with Examples 0

Pyramid Patterns in C++ with Examples

Program 1 // Star Pyramid Program #include<iostream> #define clrscr() system(“cls”) using namespace std; int main() { int n,m; int i,j,k; cout<<“\n Enter the limit of row”; cin>>n; m=n; for(i=1;i<=n;i++) { for(j=1;j<=m-1;j++) { cout<<” “;...

C++ Program on Exception Handling 0

C++ Program on Exception Handling

Program 1 #include<iostream> #include<stdexcept> using namespace std; int main() { int a,b,c; cout<<“Enter two number”; cin>>a>>b; try { if(b==0) throw(runtime_error(“Can not devide by Zero”)); c=a/b; cout<<c; } catch(const std::exception &e) { std::cerr << e.what()...

Constructor for Multiple Object in C++ 0

Constructor for Multiple Object in C++

Program 1 // Test Constructor for multiple Object #include<iostream> #define clrscr() system(“cls”) using namespace std; class Test { int n; public: Test() { cout<<” I am constructor\n”; n=10; } void incr() { ++n; }...