Untitled
unknown
plain_text
2 years ago
387 B
11
Indexable
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
float a;
printf("pls enter the edge of the square:");
scanf("%f", &a);
if (a<=0){
printf(" the edge must be a positive number!");
} else {
printf(" the perimeter of the square is %f\n", a*4);
printf(" the are of the square is %f\n", a*a);
}
return 0;
}Editor is loading...