In: Computer Science
C ++ code that accepts any measurement in meters entered by the user through the keyboard and displays the equivalent measurement in feet on the console (1 Meters = 3.2808 Feet). Use proper variable names.
C++ code:
#include <iostream>
using namespace std;
int main(){
//initializing meter and feet
float meter,feet;
//asking for measurement in meters
cout<<"Enter measurement in meters:";
//accepting measurement in meters
cin>>meter;
//finding measurement in feet
feet=meter*3.2808;
//printing measurement in feet
cout<<"Measurement in feet: "<<feet<<endl;
return 0;
}
Screenshot:
Input and Output: