C Program to Find the Perimeter of a Square

C Program to Find the Perimeter of a Square

Write a C program to find the perimeter of a square. This C example allows entering the square side and uses the (4 * side) math formula to calculate the perimeter. #include <stdio.h> int main() { float Sqrside, Sqrperimeter; printf(“Enter the Square Side = “); scanf(“%f”,&Sqrside); Sqrperimeter = 4 * Sqrside; printf(“The perimeter of a … Read more

C Program to Find the Area of a Semicircle

C Program to Find the Area of a Semicircle

Write a C program to find the area of a semicircle. This C example allows entering the semicircle radius and uses it to calculate the area. Semicircle Perimeter. = 3.14 * radius Semicircle Area = 1/2πr² #include <stdio.h> int main() { float clRadius, clArea, clPerimeter; printf(“Enter the Semicircle Radius = “); scanf(“%f”,&clRadius); clPerimeter = 3.14 … Read more