lab2.java - import java.util.Scanner public class lab2 public static void main(String args Scanner input = new Scanner(System.in

lab2.java - import java.util.Scanner public class lab2...

This preview shows page 1 out of 1 page.

import java.util.Scanner; public class lab2 { public static void main(String[] args) { // Scanner input = new Scanner(System.in); // System.out.println("Enter number: "); // int num = input.nextInt(); // int fact = 1; // for (int i = 1; i <=num; i++) { // fact=fact*i; // } // System.out.println(fact); // int i = 1; // do { // fact = fact * i; // i++; // // } // while (i <= num); // System.out.println(fact); // int n1=0; // int n2=1; // for (int i=1;i<=num;i++){ // System.out.println(n1); // int sum =n1+n2; // n1=n2; // n2=sum; // boolean prime=false;
Image of page 1

You've reached the end of your free preview.

Want to read the whole page?

  • Spring '17
  • Ijlal

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture