//compute area of the circle. class area{ public static void main(String[] args) { double pi,a; pi=3.1415; for(int r=1;r<5;r++) { a=pi*r*r; } System.out.println("Area of the circle is"+a); } }
cmd shows an error saying "a" needs to be initialized.. how can i do that when "a" is the result??