Example3_6

posted Feb 1, 2014, 7:58 AM by dldar masud   [ updated Feb 1, 2014, 8:05 AM by Karwan Jacksi ]


import java.util.*;

public class Example3_6 {
  
     static Scanner in = new Scanner(System.in); 
         public static void main(String[] args){
int x, i = 0, sum = 0;
System.out.print("Enter an integer number : ");
x = in.nextInt();
  while(x != 0)
   {
sum += x * x;
System.out.print("Enter an integer number : ");
x = in.nextInt();
}
System.out.println("Sum of square is : " + sum);
System.out.println("Number of numbers is : " + i);
}
}



ċ
Example3_6.java
(0k)
Karwan Jacksi,
Feb 1, 2014, 7:58 AM
Comments