Monday 13 March 2017

C Program to show use of #define Preprocessor Directives

#include <stdio.h>
#include <conio.h>
 
#define PI 3.141
 
int main(){
    int radius;
    float circumference;
    printf("Enter the radius of circle\n");
    scanf("%d", &radius);
     
    circumference = 2*PI*radius;
     
    printf("Circumference of Circle = %f", circumference);
     
    getch();
    return 0;
}

No comments:

Post a Comment