MACROS2 - printf"enter the value of base and hieght...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
#define PI 3.1428571 #define a_tri(x,y) 1/2.0*x*y #define a_rec(x,y) x*y #define a_cir(x) PI*x*x #include<stdio.h> #include<conio.h> void main (void) { float x,y,a_tr ,a_re,a_ci; clrscr(); printf("enter the value of length and breadth for area of rectangle: "); scanf("%f%f",&x,&y); a_re=a_rec(x,y);
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: printf("enter the value of base and hieght for area of triangle: "); scanf("%f%f",&x,&y); a_tr=a_tri(x,y); printf("enter the value of radius for area of triangle: "); scanf("%f",&x); a_ci=a_cir(x); printf("area (rectangle) = %f area (triangle) = %f\narea (circle) = %f",a_re,a_tr,a_ci); getch(); }...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online