write program to find area of a square

I'm new to c++ and I have no idea what I'm doing. My assignment is to Please write a C++ program to find the area of a square, input the length of the side, and output your answer to the screen. Can anyone help me with what to do?
input the length of the side

Area of a square is side*side
output your answer to the screen

Program done.

To get the input use std::cin
To output the result use std::cout
If you don't know what I'm talking about I'm sorry but you need to pick up the book and review
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <iostream>
using namespace std;

int main()
{

int side;
cout << "Input length of side: " << endl;
cin >> side;

int area = side * side; 

cout << "area is: " << area << endl;

return 0;
}

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <iostream> //basic libraries
#include <cstdio>
#include <cstdlib>
using namespace std; // removes std::

int main()
{

int side; // creates variable side
cout << "Input length of side: "; // prompts user
cin >> side; // stores input into variable side
cout << endl; // new line

int area = side * side; // new variable area which is side * side

cout << "area is: " << area << endl; // outputs area

system("PAUSE"); // pauses program

return 0; // ends program
}
Topic archived. No new replies allowed.