You are on page 1of 4

SOLUTION OF

PROGRAMME
Sum of two number 62 and 99
#include<iostream.h>
#include<conio.h>
int main()
{
int a, b, Total;
a = 62;
b = 99;
Total = a+b;
cout<<" Total Of Two Number = "<<Total<<endl;
getch();
}

Triangle pattern
#include<iostream.h>
#include<iomanip.h>
#include<conio.h>

NOAMAN AKBAR 0321-6717024

void main()
{
cout<<setw(9)<<"*"<<endl;
cout<<setw(10)<<"***"<<endl;
cout<<setw(11)<<"*****"<<endl;
cout<<setw(12)<<"*******"<<endl;
getch();
}

Miles per gallons


#include<iostream.h>
#include<conio.h>
void main()
{
float a,b,c;
cout<<"enter the no. of gallons of gas car tank can hold"<<endl;
cin>>a;
cout<<"enter num of miles driven with full tank"<<endl;
cin>>b;
c=b/a;
cout<<"number of miles per gallon :"<<c<<" miles";
getch();

NOAMAN AKBAR 0321-6717024

Celsius to farhenhite
#include<iostream.h>
#include<conio.h>
void main()
{
float a,b;
cout<<"Enter the Temperature in Celsius"<<endl;
cin>>a;
b=1.8*a+32.0;
cout<<"Temperature in Fahrenheit is "<<b;
getch();
}

Minimum/maximum
#include<iostream.h>
#include<conio.h>
void main()
{
float a,b;
cout<<"enter first number"<<endl;
cin>>a;

NOAMAN AKBAR 0321-6717024

cout<<"enter second number"<<endl;


cin>>b;
if(a>b)
{
cout<<"the maximum value is "<<a<<endl;
cout<< "the minimum value is "<<b;
}
else
{
cout<<"the maximum value is "<<b<<endl;
cout<< "the minimum value is "<<a;
}
getch();
}

NOAMAN AKBAR 0321-6717024

You might also like