6 Aug 2019

  • August 06, 2019
  • Amitraj

/* C Program find to area and perimeter of Rectangle */        by Amit raj purohit
 http://codevidyalay.blogspot.com 

#include<stdio.h>
int main()
{
float l,b,area,perimeter;

printf("Enter 2 values:");

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

area=l*b;
perimeter=2*(l+b);

printf("Aera=%f\n",area);
printf("Perimeter=%f",perimeter);
return 0;
}


INPUT/OUTPUT:
Enter 2 values:2 3
Aera=6.000000
Perimeter=10.000000









Related Posts:

  • Towers of Hanoi problem using recursion .. Towers of Hanoi problem using recursion:- This C Program uses recursive function & solves the tower of hanoi. The tower of hanoi is a mathematical puzzle. It consists of threerods, and a number of disks of different… Read More
  • Prime Number program in C    Prime Number program in C Prime number is a number that is greater than 1 and divided by 1 or itself. In other words, prime numbers can't be divided by other numbers than itself or 1. For example 2, 3… Read More
  • Palindrome number in C Palindrome number in C A palindrome number is a which remains the same on reversal. For example, some palindrome numbers are 8, 121, 212, 12321, -454. To check whether a number is a palindrome or not first we reverse i… Read More
  • Matrix multiplication in C Matrix multiplication in C C program to multiply two matrices (two-dimensional arrays) which will be entered by a user. The user will enter the order of a matrix and then its elements and similarly inputs the second m… Read More
  • Array in C *Array:-  Array is a collection of similar data elements.it is also known as Homogeneous data type. -> The syntax of Array declaration is as follows:                … Read More

Translate

Popular Posts