Answer to Question #256405 in C++ for RAHUL

Question #256405

Q: Create a function “square”, which calculate and displays square of any number entered through the keyboard.  

1
Expert's answer
2021-10-30T03:13:34-0400
#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;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS