C++ : squaring number in C++ script
#include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{ ("cls"); //For clearscreen funtion for Turbo C++ version clscr() also work
int var, sqrs;
cout << "enter varible:";
cin >> var;
sqrs = var * var;
cout << "\n" << "The square is :" << sqrs;
return 0;
}
Result -
https://code.sololearn.com/c45mw9pXGOUs/#cpp Use this script from here
#include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{ ("cls"); //For clearscreen funtion for Turbo C++ version clscr() also work
int var, sqrs;
cout << "enter varible:";
cin >> var;
sqrs = var * var;
cout << "\n" << "The square is :" << sqrs;
return 0;
}
Result -
https://code.sololearn.com/c45mw9pXGOUs/#cpp Use this script from here