Write an algorithm to read the side of a square and display its area. Also, draw a flowchart to read any two numbers from the user, and display the greater number.
Answers
Answered by
0
Answer:
The program to compute area of a square is :-
#include <stdio.h>
int main()
{
float side, area;
printf("Enter the sides of a square :- ");
scanf("%f",&side);
area= side* side;
printf("Area of a Square is :- %0.2f", area);
}
Output -
Enter the sides of a square :- 2
Area of a Square is :- 4.00
Algorithm -
Step 1 - Start
Step 2 - Declare floating type variables
Step 3 - Read value for side of square
Step 4 - Multiply sides and store the result
area <- side * side
Step 5 - Display area of square
Step 6 - StopExplanation:
Similar questions