#include<iostream>
using namespace std;

int main ()
{

    char a;

    double length;
    double width;
    double Area;

    cout<<"Please\n";

    cout<<"\t1- Enter \"S\" or \"s\" to calculate the square area\n";
    cout<<"\t2- Enter \"R\" or \"r\" to calculate the rectangle area.\n";
    cout<<"\t3- Enter any Key to Exit\n";


    cout<<"Please enter the length of square";
    cin>>length;

    cout<<"Please enter the length and the width of square";
    cin>>length;
    cin>>width;


if(a=='S'||a=='s')
    {
        cout<<"Area of square=" ;

        Area = length*length;
        cout<<Area;
    }     

  if(a=='R'||a=='r')
{
    cout<<"Area of rectangle=";
    Area = width*length;
    cout<<Area;
}
  {
  else
      cout<<"Thank you";
  }


    system("pause");
    return 0;
}

Recommended Answers

All 3 Replies

ea036e1994c1943c5aa936885584c3bd

This post has no text-based content.

this will work ............ :)

thaaaaaaaaaaaanks =)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.