Logo 
Search:

C Programming Articles

Submit Article
Home » Articles » C Programming » Homework HelpRSS Feeds

Program to find area of rectangular

Posted By: Thomas Evans     Category: C Programming     Views: 5081

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
  
Share: 


Didn't find what you were looking for? Find more on Program to find area of rectangular Or get search suggestion and latest updates.

Thomas Evans
Thomas Evans author of Program to find area of rectangular is from London, United Kingdom.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!