C Plus Plus Programming

You can learn all c++ programming in this website easilly.

Responsive Ads Here

Adds

Showing posts with label Sourcecodes. Show all posts
Showing posts with label Sourcecodes. Show all posts

Monday, January 21, 2019

how we find vowel words



Programme:

#include<iostream>
using namespace std;
int main()
{
char ch;
cout<<"Enter an alphabet=";
cin>>ch;
{
if(ch=='A'||ch=='a'||ch=='E'||ch=='e'||ch=='I'||ch=='i'||ch=='O'||ch=='o'||ch=='U'||ch=='u')
cout<<ch<<":is a vowel";
else
cout<<ch<<":is not a vowel";
}
}

how to find even odd numbers

Programe

#include <iostream>
using namespace std;
int main()
{
int n ;
cout<<"Enter A Number=";
cin>>n;
{
if(n%2==0)
cout<<n<<":IS Even Number";
else
cout<<n<<":IS odd Number";


}
}

how to creat Cricket Team Management System

Programe

#include<iostream>
#include<conio.h>
#include<string>
#include<iomanip>
using namespace std;
struct cricketer
{
char name[15];
int runs;
int innings;
int tno;
float avg;
};
int main()
{
int runs,innings,i;
float avg;
cricketer rec[5];
cout<<"\nEnter 5 records including following details\n";
cout<<"1)      Player's Name\n";
cout<<"2)       Runs";
cout<<"3)       Innings";
cout<<"4)       Times Not Out";
for(i=0;i<5;i++)
{
cout<<"\nEnter Player Name:-";
cin>>rec[i].name;
cout<<"Enter Runs:-";
cin>>rec[i].runs;
cout<<"Enter Innings:-";
cin>>rec[i].innings;
cout<<"Enter Time Not Out:-";
cin>>rec[i].tno;
rec[i].avg=float(rec[i].runs)/rec[i].innings;
{
cout<<"n\n\n";
cout<<setw(49)<<"CRICKETR'S TABLE\n";
cout<<setw(15)<<"PLAYER'S NAME"<<setw(15)<<"RUNS"<<setw(15)<<"INNINGS";
cout<<setw(20)<<"Times not Out"<<setw(12)<<"Average\n";
for(i=0;i<5;i++)
{
cout<<setw(15)<<rec[i].name<<setw(15)<<rec[i].runs<<setw(12)<<rec[i].innings;
cout<<setw(18)<<rec[i].tno<<setw(16)<<rec[i].avg<<endl;
{
cout<<endl<<endl<<endl;
cout<<setw(43)<<"Finish\n";
getch();
 
}
}
}
}
}

speed calculator



Programme


#include <iostream>
using namespace std;
int main()
{
double distance,speed,time;
cout<<"Enter distance in kilometer:";
cin>>distance;
cout<<"Enter speed of your vehicle (Mph):";
cin>>speed;
{
time=distance/speed;
cout<<"Time required To Reach  Distance (in hours) ="<<time<<endl;
}

}

creat age calculator


Programme:


#include<iostream>
using namespace std;
int main()
{
int n,age;
cout<<"Enter Your Age:";
cin>>n;
switch(n)
{
case 1 ...10:
cout<<"Kid";
break;
case 11 ...15:
cout<<"childhood";
break;
case 16 ...20:
cout<<"Young";
break;
case 21 ...30:
cout<<"Mature";
break;
case 31 ...50:
cout<<"old man";
break;
default:
cout<< "You are Older Man";
break;
{
cout<<"........................."<<endl;
cout<<"Software Doveloper";
cout<<"Lala Munir";
}
}
}

How we creat a calculator


Programme:



#include<iostream>
#include<conio.h>
using namespace std;
int main()
{
int a,b,result;
char option,n;
do
{
cout<<"What Opration you to do want"<<endl;
cout<<"+.Addition"<<endl;
cout<<"-.Subtraction"<<endl;
cout<<"*.Multiply"<<endl;
cout<<"/.Devide"<<endl;
cin>>n;
cout<<"Enter First Number:";
cin>>a;
cout<<"Enter Second Number:";
cin>>b;
switch(n)
{
case '+':
result=a+b;
cout<<"Addition Of Two Number is="<<result<<endl;
break;
case '-':
result=a-b;
cout<<"Subtraction Of two number is="<<result<<endl;
break;
case '*':
result=a*b;
cout<<"Multiuplication Of Two Number is="<<result<<endl;
break;
case '/':
result=a/b;
cout<<"Division Of Two Number is="<<result<<endl;
break;
default:
cout<<"Invalid Number"<<endl;
}
cout<<"Do You Want To continue Press Y?"<<endl;
option=getch();
}
while(option=='y');
getch();
return 0;

}