Answer to Question #263002 in C++ for Rille

Question #263002

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.

1
Expert's answer
2021-11-11T17:38:59-0500
#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;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS