plain/semester_1/erg6_ask1/Erg6_Ask1.java
public static void main(String[] args) {
        int n, npar, i;
        
        do { System.out.print("enter a number between 0 and 10: ");
            n = scannerUserInput.getInteger();
        }
        while ( n < 0 || n > 10 );
        if ( (n == 0) || (n == 1)) {
            npar = 1;
        }
        else {
            npar = 1;
            for ( i=2; i<=n; i++ ) {
                npar = npar*i;
            }
        }
        System.out.println("npar's value is " + npar);
    }
/**
     * @param args the command line arguments
     */
@param args the command line arguments
@param args the command line arguments
public static void main(String[] args) {
        int n, npar, i;
        do { System.out.print("enter a number between 0 and 10: ");
            n = scannerUserInput.getInteger();
        }
        while ( n < 0 || n > 10 );
        if ( (n == 0) || (n == 1)) {
            npar = 1;
        }
        else {
            npar = 1;
            for ( i=2; i<=n; i++ ) {
                npar = npar*i;
            }
        }
        System.out.println("npar's value is " + npar);
    }
public static void main ( String [ ] args ) { int n , npar , i ; do { System . out . print ( "enter a number between 0 and 10: " ) ; n = scannerUserInput . getInteger ( ) ; } while ( n < 0 || n > 10 ) ; if ( ( n == 0 ) || ( n == 1 ) ) { npar = 1 ; } else { npar = 1 ; for ( i = 2 ; i <= n ; i ++ ) { npar = npar * i ; } } System . out . println ( "npar's value is " + npar ) ; }
@param args the command line arguments
@param args the command line arguments