~Assuming there are 7.481 gallons in a cubic foot, write a program that asks the user to enter a number of gallons, and then displays the equivalent in cubic feet.
CODE:
#include <iostream>
/* Author: Danial Ahmed
Website: http://program-cpp.blogspot.com/
Contact: danyalphc@gmail.com */
using namespace std;
OUTPUT:int main(){
float gal, cubic;
cout << "Enter amount in gallons: ";
cin >> gal;
cout << gal << "gallons is equals to " << gal/7.481 << " Cubic feet" << endl;
return 0;
}
No comments:
Post a Comment