Area of Rectangle - C program

Program:

#include<stdio.h>
//#include<conio.h>
 void main()
 {
 float x,y,area;int c=253;
 //clrscr();
 printf("\n\t***A PROGRAMME TO FIND THE AREA OF THE RECTANGLE***");
 printf("\nEnter the LENGTH(cm):");
 scanf("%f",&x);
 printf("\nEnter the BREADTH(cm):");
 scanf("%f",&y);
 area=x*y;
 printf("\n\tAREA OF THE RECTANGLE=%fcm%c\n",area,c);
// getch();
 }


Output:
nn@linuxmint ~ $ gcc sam.c
nn@linuxmint ~ $ ./a.out

    ***A PROGRAMME TO FIND THE AREA OF THE RECTANGLE***
Enter the LENGTH(cm):10

Enter the BREADTH(cm):20

    AREA OF THE RECTANGLE=200.000000cm
nn@linuxmint ~ $

0 comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...