Has nothing to do with unreal but can anyone tell me if this is how this works?

was just wondering if this would work. thanks. and im pretty sure that I messed up the bool part thx.

I did run it, it said “return true” and “return false” was a problem.

#include <iostream>

int room_width {0};
int room_length {0};

void data()
{
    // room width
    std::cout << "Enter the WIDTH of the room -- ";
    std::cin >> room_width;
    std::cout << std::endl;
    
    // room length
    std::cout << "Enter the LENGTH of the room -- ";
    std::cin >> room_length;
    std::cout << std::endl;
    
    // math
    std::cout << "The area of the room is " << room_length * room_width << " square feet" << std::endl;
}

bool room_math()
{
    // makeing room length times room width equal room square feet
    int room_square_feet {room_length * room_width};
    
    // makeing shure that length times room width equal room square feet
    if (room_square_feet == room_length * room_width)
    {
        return true
    }
    else
    {
        return false
    }
}

int main()
{
    data();
    room_math();
    
    return 0;
} 

You’re missing semicolons.

oh🤦🏻‍♂️

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms