Ticker

6/recent/ticker-posts

Calculate Areas Program

                                    


  • Area of Square -

#include <stdio.h>

int main()
{ int a,s;
    printf("Enter the side ");
    scanf("%d",&s); //Input the numbers
    a=s*s; //performing the operater
    printf("The area is %dsq.units",a); // printing the value 

    return 0;
}




  • Area of Rectangle - 

#include <stdio.h>

int main()
{ int a,l,b;
    printf("Enter the sides ");
    scanf("%d %d",&l,&b); //Input the numbers
    a=l*b; //performing the operater
    printf("The area is %dsq.units",a); // printing the value 

    return 0;
}




  • Area of Circle - 

#include <stdio.h>

int main()
{ int r,a;
    printf("Enter the radius ");
    scanf("%d",&r); //Input the numbers
    a=3.14*r*r; //performing the operater
    printf("The area is %dsq.units",a); // printing the value 

    return 0;
}  


Post a Comment

0 Comments