write a program to find area and perimeter of a square (area =a*a,perimeter= 4a in c++
Answers
Answer:
/*
* C Program to calculate area of a square
*/
#include <stdio.h>
#include <conio.h>
int main(){
float side, area;
printf("Enter length of side of square\n");
scanf("%f", &side);
/* Area of Square = Side X Side */
area = side * side;
printf("Area of square : %0.4f\n", area);
getch();
return 0;
Explanation:
Program Output
Enter length of side of square
2.5
Area of square : 6.2500
Hope this answer helps you
Answer:
Explanation:
Question:
write a program to find area and perimeter of a square
(area =s*s,perimeter= 4s in c++
Let's find the answer in a step-by-step manner which'll help you understand Hope you find this answer satisfactory and self-explanatory. And if you do , please don't hesitate to express your gratitude
then press F2 to save the program
↓
Then press Alt + F9 to compile (for transilating High level language into machine language) Compiler and Interpretor are the transilators used
↓
Then press Ctrl + F9 to run ther program
→ enter the side
→ press enter key