Q: Create a function “square”, which calculate and displays square of any number entered through the keyboard.
#include <iostream>
using namespace std;
void square(){
int area,length;
cout << "Enterr the length" << endl;
cin>>length;
area=length*length;
cout<<"The area is: "<<area<<endl;
}
int main()
{
square();
return 0;
}
Comments
Leave a comment