• Breaking News

    Saturday 7 January 2017

    C++ Program to convert gallons into cubic feets

    ~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;
    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;
    }
    OUTPUT:


    No comments:

    Post a Comment