Write A Program That Gets Temperature From The User in Celsius and Convert It Into Fahrenheit Using The Formula F 9/5 Cel+32

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 3

Write a program that gets temperature from the

user in Celsius and convert it into Fahrenheit using


the formula F=9/5*Cel+32
#include <conio.h>
#include <iostream>
void main ()
{
Clrscr();
float cel, faren;
cout << "Please enter temperature in celcius:";
cin >> cel;
faren=9.0/5.0*cel+32;
cout << "The value you entered in temperature: " << faren;
getch();
}
Write a program that input 4 numbers and calculate
the sum, average and product of all the numbers.
#include <conio.h>
#include <iostream>
void main ()
{
Clrscr();
int a,b,c,sum,product;
float avg;
cout << "Please enter value a, b, c:";
cin >> a >> b>>c;
sum=a+b+c;
product= a*b*c;
avg= sum/3.0;
cout << sum<<product << avg;
getch();
}
Write a program that inputs base and height from
the user and calculate area of a triangle by using
the formula Area=1/2*base*height
#include <conio.h>
#include <iostream>
void main ()
{
Clrscr();
int base, height , area;
cout << "Please enter value base and height:";
cin >> base >> height ;
area= 0.5*base*height;
cout << area;
getch();
}

You might also like