4/25/21

C Program to Find Area and Perimeter of Rectangle

C Program to Find Area and Perimeter of a Given Length and Breadth

#include<stdio.h>

void main ()

{

float l,b,area,peri;

printf("Enter length breadth of rectangle=");

scanf("%f%f",&l,&b);

area=l*b;

peri=2*(l+b);

printf("Area is=%f",area);

printf("\nperimenter is=%f",peri);

if (area<=peri)

        printf("\nPerimeter is greater than area");

else

printf("\nArea is greater than perimeter");

getch();

}

Output:-

Explanation:- 

 In this program first, we have accepted input from the user (length and breadth). After that we put the formula of area and perimeter of rectangle into it. After that program gives the area and perimeter of rectangle as output. Then we compare the area and perimeter to check the which one of these are greatest. 

"+y+""}else{if(A==5){c+='
  • '+w+""+y+"
  • "}else{if(A==6){c+='
  • "+w+'
    '+u+""+y+"
  • "}else{c+='
  • "+w+"
  • "}}}}}s.innerHTML=c+=""+y;d.callBack()};randomRelatedIndex=h;showRelatedPost=g;j(d.homePage.replace(/\/$/,"")+"/feeds/posts/summary"+e+"?alt=json-in-script&orderby=updated&max-results=0&callback=randomRelatedIndex")})(window,document,document.getElementsByTagName("head")[0]); //]]>

    0 comments:

    Post a Comment

    Follow on Twitter

    Linkedin

    Categories

    Contact Form

    Name

    Email *

    Message *

    Mad About Computer. Powered by Blogger.
    This site is in no way affiliated with or endorsed by specified business. It exists as a compendium of supporting information intended for informational purposes only. If you want to buy this website, please don't hesitate to contact us via e-mail: "d e n a c c 9 7 7 (at) g m a i l (dot) c o m" (delete spaces) or you can find and buy it on Afternic domain auctions.