C Tutorial
Area of a square = side * side
This C program gets side of the square as user inputs and computes the area of a square.
#include<stdio.h> void main() { int side, area=0; printf("\nFinds area of square\n-------------------"); printf("\nEnter side: "); scanf("%d", &side); area = side * side; printf("Area of square: %d", area); }Output:
$ cc area-of-square.c $ ./a.out Finds area of square ------------------- Enter side: 6 Area of square: 36
C Tutorial
Privacy Policy | Copyright2020 - All Rights Reserved. | Contact us
| Report website issues in Github
| Facebook page
| Google+ page