0

What's wrong in this?

public class Program { public static void main(String[] args) { int r,cir,area; r=7; cir=22/7*r; area=22/7*r^2; System.out.println("The circumference is "+cir); System.out.println("The area is "+area); } }

16th Jun 2018, 8:18 AM
coding on my way
2 Answers
+ 1
*area and cir should be float *replace 22 by 22.0 or declare r as float * ^ stands for xor .use pow function from math
16th Jun 2018, 8:23 AM
‎ ‏‏‎Anonymous Guy
0
Thanks
16th Jun 2018, 8:54 AM
coding on my way