Computer Science, asked by cinthyafabula, 7 months ago

write a c++ problem to find the area of a square​

Answers

Answered by p705suji
0

/* program to calculate the area of square */

#include <iostream>

using namespace std;

int main() //function main begins program execution

{

  int square_area, square_side;

  cout << "Enter the side of square:";

  cin >> square_side;

  square_area = square_side * square_side;

  cout << "Area of Square: " << square_area << endl;

  return 0;

} // end main

Answered by Berseria
8

Required Program :

To find Area of Square :

#include <iostream>

using namespace std ;

int main ( )

{

float side , area ;

cout<< "Enter the Side of Square : ";

cin>>side ;

area = side * side ;

cout<<"Area = " <<area<<ends ;

return 0 ;

}

Output :

Enter the side of square : 8

Area = 64

Structure of C++ Program :

// Comment line

#include <iostream>

using namespace std ;

int main ( )

{

........

Body of Program ;

............

return 0 ;

}

Similar questions