0% found this document useful (0 votes)
6 views3 pages

C++ Conversion Programs Overview

kjn

Uploaded by

moha amro
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views3 pages

C++ Conversion Programs Overview

kjn

Uploaded by

moha amro
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Mohamed alamrouni 3787

Answer 1:

#include <iostream>
using namespace std ;
int main () {
double distance ;
cout <<"enter distance in kilometers\n" ;
cin >> distance;
cout << "the equivalent is " << distance*1.61 << " miles" ;
return 0;
}

Answer 2:
#include <iostream>
using namespace std ;
int main () {
double age ;
cout << "enter your age\n" ;
cin >> age ;
cout << "your age in months is " << age*12 << "months" ;
return 0 ;
}

Answer 3:
#include <iostream>
using namespace std ;
int main () {
double temperature ;
cout << "enter the temperature in celsius\n" ;
cin >> temperature ;
cout << "the equivalent temperature in fahrenhiet is " << 1.8*temperature+32 ;
return 0 ;
}

Answer 4:
#include <iostream>
using namespace std ;
int main () {
int hours ;
int minutes ;
cout << "enter the number of hours amd minutes\n" ;
cin >> hours ;
cin >> minutes ;
cout << "the time is " << hours << ":" << minutes ;
return 0 ;
}

Answer 5:
#include <iostream>
using namespace std ;
int main () {
double lyears ; // lyears = light years
cout << "enter the the number of light years that you want in astronomical units\n" ;
cin >> lyears ;
cout << lyears << " light years " << "are " << lyears * 63.240 << " astronomical units" ;
return 0 ;
}

You might also like