/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package p145number3;
/**
*
* @author chris.belsky
*/
public class P145number3 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
int count=0;
int sum=0;
int product=1;
do
{
count++;
product*=count;
sum+=count;
if(count == 5)
System.out.println("sum = " +sum);
System.out.println("Product = " + product);
}while(count<5) ;
}
No comments:
Post a Comment