Computer Science, asked by muvvadhanush007, 11 months ago

Computers :

Write 'Microsoft Small Basic programs to calculate Area and Perimeter of square and Rectangle by reading the user input values (i.e, Length and breadth for the Rectangle and side for the square).​

Answers

Answered by alishasajeesh
12

This is in c++ program to find area and perimeter of rectangle

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int len, bre, peri, area;

cout<<"Enter length and breadth of the rectangle :";

cin>>len>>bre;

area=len*bre;

peri=(2*len)+(2*bre);

cout<<"Area = "<<area<<"\tPerimeter="<<peri;

getch();

}

To find square area and perimeter

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int side, peri, area;

cout<<"Enter length of a side of square :";

cin>>side;

area=side*side;

peri=4*side;

cout<<"Area = "<<area<<"\tPerimeter="<<peri;

getch();

}


muvvadhanush007: sorry ! not this answer
alishasajeesh: okk
Answered by mail2rheaagr
42

Answer:

TextWindow.Write("How long is the rectangle? ")

length = TextWindow.ReadNumber()

TextWindow.Write("How wide is the rectangle? ")

width = TextWindow.ReadNumber()

area = length * width

perimeter = 2 * length + 2 * width

TextWindow.WriteLine("The area of the rectangle is " + area + ".")

TextWindow.WriteLine("The perimeter of the rectangle is " + perimeter + ".")

Explanation:

Similar questions