Martes, Marso 20, 2012

5

  *Give at least 5 sample programs

#include<iostream.h>
void main( )
{
int a,b,c,sum,deff,prod;
cout<<"enter first number:";
cin>>a;
cout<<"enter second number:";
cin>>b;
cout<<"enter third number:";
cin>>c;
sum=a+b+c;
deff=a-b-c;
prod=a*b*c;
cout<<"the sum is:";
cout<<sum;
cout<<"the deff is:";
cout<<deff;
cout<<"the prod:";
cout<<prod;
}


#include<iostream.h>
void main( )
{
int a,b,ave;
cout<<"enter first number:";
cin>>a;
cout<<"enter second number:";
cin>>b;
ave=a/b;
cout<<"the average is:";
cout<<ave;
}

#include<iostream.h>
void main( )
{
int a,b,prod;
cout<<"enter first number:";
cin>>a;
cout<<"enter second number:";
cin>>b;
prod=a*b;
cout<<"the product is:";
cout<<prod;
}
 
#include<iostream.h>
void main( )
{
int a,b,sum,deff;
cout<<"enter first number:";
cin>>a;
cout<<"enter second number:";
cin>>b;
 sum=a+b;
deff=a-b;
cout<<"the sum is:";
cout<<sum;
cout<<"the deff is:";
cout<<deff;
}
 
 
 #include<iostream.h>
void main( )
{
cout<<"hello world!";
}
#include<iostream.h>
void main( )
{
int a,b,sum,deff;
cout<<"enter first number:";
cin>>a;
cout<<"enter second number:";
cin>>b;
 sum=a+b;
deff=a-b;
cout<<"the sum is:";
cout<<sum;
cout<<"the deff is:";
cout<<deff;
}
#include<iostream.h>
void main( )
{
int a,b,prod;
cout<<"enter first number:";
cin>>a;
cout<<"enter second number:";
cin>>b;
prod=a*b;
cout<<"the product is:";
cout<<prod;
}
#include<iostream.h>
void main( )
{
int a,b,ave;
cout<<"enter first number:";
cin>>a;
cout<<"enter second number:";
cin>>b;
ave=a/b;
cout<<"the average is:";