Calculate square of a number in C

#include <iostream>
using namespace std;
 
int main() {
    double  n;
    cout << "Input a number and press ENTER: ";
    cin >> n;
    cout << "The square is: " << n * n << endl;
    system("PAUSE");
    return 0;
}

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.