Pages

Friday, March 21, 2025

calculate area of a square in C++

 #include<iostream>

using namespace std;

//code to calculate the area of a square = side * side.
int main() {
    int side1;
    int side2;
    cout<<"enter side 1: ";
    cin>>side1;

    cout<<"enter side 2: ";
    cin>>side2;

    int area = side1*side2;

    cout<<"area of square is "<<area<<endl;


    return 0;

}

No comments:

Post a Comment

how to become red on codeforces by Errichto Algorithms | explained simply in a blog

 Yes. I found an available transcript of the video and summarized it simply. The video is “How To Become Red Coder? (codeforces.com)” by Err...