Sunday, April 30, 2023

find the larger element between area and perimeter of a triangle

 //find the larger element between  area and perimeter of a triangle 

#include "stdio.h"

int main (){

float per,area,lng,brt;   /*lng--->length ;per--->perimeter ; brt--->breadth*/

printf ("Enter the length and breadth of a triangle \n");

scanf ("%f%f",&lng,&brt);

area=lng*brt;

per=2*(lng+brt);

if (area>per){

printf ("The area of triangle is bigger than it's perimeter \n");

}

else {

printf ("The area of triangle is smaller than it's perimeter \n");

}

return 0;

}


            output                 output                  output                output 

Enter the length and breadth of a triangle

4

5

The area of triangle is bigger than it's perimeter

No comments:

Post a Comment

print a multiplication table of any integer taking from user

 // print a multiplication table of any integer taking from user  #include "stdio.h" int main () { int n,mul,i; printf ("...