Hi I just started learning c yesterday and I wrote this simple c program to find the area of a circle when you input the radius.
The problem is that it displays the radius as a whole number rounded down. Is there a way to make it display decimals, or better yet is there a way to make it round up or down depending upon the number? ex. 19.4=19, 19.5=20.Code:#include <stdio.h> #include <stdlib.h> int radius, area; int main() { printf( "Enter radius (i.e. 10): " ); scanf( "%d", &radius ); area = (int) (3.14159 * radius * radius); printf( "\n\nArea = %d\n", area ); system("PAUSE"); return 0; }