19.6.20

c program on macros with arguments


PROGRAM ON MACROS WITH ARGUMENTS
#define PI 3.142857
#define AREA(x)PI*x*x
void main()
{

    float r,a;
    printf("Enter radius of a circle");
    scanf("%f",&r);
    a=AREA(r);
    printf("AREA of the circle=%f",a);
}

OUTPUT
Enter radius  of a circle 45
AREA of the circle6364.285645                                      

No comments:

Post a Comment

JAVA program pattern 2

import java.util.Scanner; public class pattern3 { public static void main(String args[]) { int i,j; Scanner sc=new Scanner(System.in); Syste...