#include
#include
void main()
{
int height,width,area;
clrscr();
height=3;
width=5;
area=1/2*height*area;
cout<<"the area of triangle is "<
getch();
}
#include
#include
void main()
{
clrscr();
int a,b,c,p;
cout<<"enter 1st number: ";
cin>>a;
cout<<"enter 2nd number: ";
cin>>b;
cout<<"enter 3rd number: ";
cin>>c;
p=a*b*c;
if (p>=10000)
cout<<"the product is greater than 10000";
else
cout<<"the product is less than 10000";
getch();
}
#include
#include
void main()
{
char name[10],address[20];
clrscr();
cout<<"enter name ";
cin>>name;
cout<<"ur name is "<
cout<<"enter ur address ";
cin>>address;
cout<<"ur address is "<NOTE: the program will not work if u enter space in the address
getch();
}
#include
#include
void main()
{
clrscr();
float b,hra,da,pf,net;
cout<<"enter basic salary ";
cin>>b;
hra=(.08)*b;
da=(.05)*b;
pf=(.03)*b;
net=hra+da-pf+b;
cout<<"ur hra is "<
cout<<"\nur da is "<
cout<<"\nur pf is "<
cout<<"\n& ur net salary is "<
getch();
}
#include
#include
void main()
{
int i,j,k,l,a[3][3],b[3][3],c[3][3];
clrscr();
for (i=0; i<3; i++)
{
cout<<"enter nos. for row(matrixA) "<<
for (j=0; j<3; j++)
{
cin>>a[i][j];;
}
}
for (i=0; i<3; i++)
{
cout<<"enter nos. for row(matrixB) "<<
for (j=0; j<3; j++)
{
cin>>b[i][j];
}
}
for (i=0; i<3; i++)
{
cout<<"\nRow"<<<"\t";
for (j=0; j<3; j++)
{
c[i][j]=(a[i][j]+b[i][j]);
cout<<<"\t";
}
getch();
}
}
#include
#include
void main()
{
int a,b,c,choice;
clrscr();
cout<<"enter 1st number: ";
cin>>a;
cout<<"enter 2nd number: ";
cin>>b;
cout<<"enter the choice from 1,2,3,4: ";
cin>>choice;
switch(choice)
{
case 1:
c=a+b;
cout<<"the result is: "<
break;
case 2:
c=a-b;
cout<<"the result is: "<
break;
case 3:
c=a*b;
cout<<"the result is: "<
break;
case 4:
c+a/b;
cout<<"the result is: "<
default:
cout<<"invalid choice";
}
getch();
}
this program displays the message typed between the quotes
#include
//header
#include //files
void main()
{
cout<<"welcome to c++";
getch();
}