Write a program to calculate the number of bricks needed to build a square room. You will ask user to enter width and height of the room, now assuming the dimensions of the bricks to be 4x4 inch, calculate the total number of bricks required to build the room.
Answers
Answered by
0
Answer:
what is dimension of room
Answered by
0
Program in C++
#include<iostream>
using namespace std;
int main()
{
int width, height;
cout<<"Enter width in inch : ";
cin>>width;
cout<<"Enter height in inch : ";
cin>>height;
int area_of_one_wall = width * height;
int total_area = 4 * area_of_one_wall;
int area_of_brick = 4 * 4;
int bricks_required = total_area / area_of_brick;
cout<<"Total number of bricks required = "<<bricks_required;
return 0;
}
Output:
Enter width in inch : 100
Enter height in inch : 60
Total number of bricks required = 1500
Similar questions