Sunday, 9 March 2014

Write a program to find area of rectangular.

Write a program to find area of rectangular.

Code for Program to find area of rectangular in C Programming

#include<stdio.h>

void main()
{
    float  length,breadth,area;
    printf("The length of rectangular  :");
    if(scanf("%f",&length)==1)
    {
        printf("The breadth of rectangular :");
        if(scanf("%f",&breadth)==1)
        {
            area=length*breadth;
            printf("The area of rectangular is :%f :",area);
        }
        else
        {
            printf("error,enter correct value");
        }
    }
    else
    {
        printf("error,enter correct value");
    }
}

========================================OUTPUT==================================
The length of rectangular  :2.34
The breadth of rectangular :2.1
The area of rectangular is :4.914000

No comments:

Post a Comment