NEED TO CHANGE THIS TO PSEUDOCODE input: Lenth Width float length, width; formul
ID: 3770897 • Letter: N
Question
NEED TO CHANGE THIS TO PSEUDOCODE
input: Lenth
Width
float length, width;
formula: Area of a square = length X width
perimeter of a square = 2X(length + width)
/* C program code to caliculate area and perimeter of a rectangle */
#include<stdio.h>
#include<conio.h>
void main()
{
// variable declaration lenght and width
float area, perimeter;
float length, width;
clrscr();
printf(" Enter the length and width of a rectangle");
// accepting the length and width values through keyboard
printf(" Length and Width= ");
scanf("%f%f",&length,&width );
// caliculating the area of a rectangle
area= length*width;
// caliculating the perimeter of a rectangle
perimeter=2*(length+width);
printf(" ****** OUTPUT ******");
printf(" Area of a rectangle is %f", area);
printf(" Perimeter of a rectangle is %f", perimeter);
getch();
}
Please Help
Explanation / Answer
write a pseduo code to caluclate the area and perimeter of a rectangle
BEGIN
Prompt for length, width
Read length of rectangle
Read width of recatangle
compute area as length times width
Compute perimeter as 2 times length+ 2 times width
display perimeter and area
END
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.