Finding cost of tile to cover W x H floor
One of the most powerful techniques you will develop is called 'separation of concerns'. What this means when it boils down is that your program can be split into discrete logical units. Ideally one module (or in the case of c++, class) will do exactly one job without depending on any other.

This has a number of benefits in that the parts can be re-used without needing any knowledge of which parts of the program are using them.

here is your program again, split into essentially three sections, or concerns. Hopefully you will see that although there are more lines of code, the logic in the main() function is easier to follow. Also you can hopefully see that the "input_data" class is an entirely autonomous entity, which could be re-used to gather data for other parts of a bigger program:

I also fixed the small logic error in your calculation, which was easier to see when the calculations were separated from the input/output code.

#include &lt;iostream&gt;

using namespace std;

double area(double width, double height)
{
    return width * height;
}

double cost_to_cover(double area, double area_per_pack, double cost_per_pack)
{
    double packs_needed = area / area_per_pack;
    double cost = packs_needed * cost_per_pack;

    return cost;
}

struct input_data {
    double area_per_pack, cost_per_pack, width, height;    // Starting square meters and cost. Width and height of floor.

    void gather() {
        cout &lt;&lt; "Enter value of 1 pack of tiles: ";
        cin &gt;&gt; cost_per_pack;

        cout &lt;&lt; "Now enter the square metres covered by the pack: ";
        cin &gt;&gt; area_per_pack;

        cout &lt;&lt; "What is the width of your room? ";
        cin &gt;&gt; width;
        cout &lt;&lt; "Now enter the height:\n";
        cin &gt;&gt; height;
    }
};

int main() {

    // concern 1 - gather data
    input_data input;
    input.gather();

    // concern 2 - perform calculations
    double room_area = area(input.width, input.height);
    double cover_cost = cost_to_cover(room_area, input.area_per_pack, input.cost_per_pack);

    /// concern 3 - output the result
    cout &lt;&lt; "You need to cover a total of " &lt;&lt; room_area &lt;&lt; " square metres.\n";
    cout &lt;&lt; "The total cost will be: " &lt;&lt; cover_cost &lt;&lt; endl;

    return 0;
}