Challenge: Rectangle Area
Completed
Read two whole numbers, the width and height of a rectangle, and print its area (width × height) in the form Area: 12.
Input
Two integers separated by a space.
Output
One line: Area: followed by the area.
Example
Input
3 4
Output
Area: 12
Editor
C++
Hints
cin >> width >> height; reads both numbers.
Don't print a question: only the answer line is checked.
Solution explanation
Read both numbers with one cin, multiply them with * and print the result.
Show solution
#include <iostream>
using namespace std;
int main() {
int width, height;
cin >> width >> height;
cout << "Area: " << width * height << "\n";
return 0;
} Output
Answer
You can practice without logging in. Log in to save completion.
Save your progress
You're practising as a guest, so your progress won't be saved.
- Track every lab you complete
- Earn verifiable lab certificates
- See your progress in every module