Computer Programming
Math and Arithmetic
Java Programming
C Programming
How To

How to write a programme in c to calculate that reads floating point number but displays only integer?

User Avatar
Wiki User
2007-08-20 15:50:19

We can use any method. As we can find out the area of the circle

by three methods as i known.

1.ordinary programming

e.g. void main() {

int r;float area;

printf("\n\tEnter radius of the circle : "); scanf("%d",&r);

area=3.14*r*r; printf("Radius = %d and area=%f",r,area); } 2. By

using macros e.g. #define PI 3.14

#define AREA(x) PI*x*x 3. We can solve by user defined functions

also


Copyright © 2020 Multiply Media, LLC. All Rights Reserved. The material on this site can not be reproduced, distributed, transmitted, cached or otherwise used, except with prior written permission of Multiply.