C++ Project – Tic Tac Toe Game
Program 1 #include <iostream> using namespace std; char board[3][3] = { {‘ ‘, ‘ ‘, ‘ ‘}, {‘ ‘, ‘ ‘, ‘ ‘}, {‘ ‘, ‘ ‘, ‘ ‘} }; void printBoard() { cout...
Program 1 #include <iostream> using namespace std; char board[3][3] = { {‘ ‘, ‘ ‘, ‘ ‘}, {‘ ‘, ‘ ‘, ‘ ‘}, {‘ ‘, ‘ ‘, ‘ ‘} }; void printBoard() { cout...
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 {...
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....
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) {...
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...
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...
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; }...
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<<” “;...
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()...
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; }...