Make a program that will input Kilometer, convert it into meter and display the converted
meter. Your program will be terminated if you input zero in the kilometer.
Make a program that will input a number and identify if it is ODD or EVEN. Your program will have
an option to have another entry or not.
#include <iostream>
using namespace std;
int main()
{
float kilometers,meters;
cout << "Enter the length in kilometers" << endl;
cin>>kilometers;
meters=kilometers*1000;
cout<<"the length in meters is: "<<meters<<endl;
//part two of the question
int number;
cout << "Enter the number " << endl;
cin>>number;
if(number%2==0)
cout<<"EVEN ";
if(number%2==1)
cout<<"ODD ";
return 0;
}
Comments
Leave a comment