Monday 20 October 2014

C Program that Calculates the area of a square by giving length of the side from the user

Program:

#include<stdio.h>
#include<conio.h>
void main( )
{
         int a,l;
         printf("\nEnter the length of the Square:");
         scanf("%d",&l);
         a=l*l;
         printf("\nArea of the Square is %d",a);
}


Input/Output:

Enter the length of the Square:10

Area of the Square is 100

0 comments:

Post a Comment