If you use float as data type
then you can get accurate result you wanted.
The main part of the programme has been given below:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
#include<conio.h> | |
int area(int); | |
int main() | |
{ | |
int r,result; | |
printf("enter the radius of circle"); | |
scanf("%d",&r); | |
result=area(r); | |
printf("Area of the circle is=%d",result); | |
getch(); | |
} | |
int area(int x) | |
{ | |
return(3.14*x*x); | |
} |
0 comments :
Post a Comment