lab8.java - import java.util.Scanner public class lab8 public static void main(String args Scanner in=new Scanner(System.in System.out.print\"Enter 1st

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

This preview shows page 1 - 2 out of 2 pages.

import java.util.Scanner; public class lab8 { // public static void main(String[] args){ // Scanner in=new Scanner(System.in); // System.out.print("Enter 1st number: "); // int a=in.nextInt(); // System.out.print("Enter 2nd number: "); // int b=in.nextInt(); // System.out.print("Enter 3rd number: "); // int c=in.nextInt(); // System.out.println("Sum is: "+sum(a,b)); // System.out.println("Sum is: "+sum(a,b,c)); // } // private static int sum(int a, int b){ // int sum=a+b; // return sum; // } // private static int sum(int a, int b, int c){ // int sum=a+b+c; // return sum; // } //} // public static void main(String[] args) { // Scanner in = new Scanner(System.in); // int[] a = {11, 2, 3, 4, 66, 78, 45}; // System.out.println("Maximum value is: " + max(a)); // String[] b = new String[5]; // b[0] = "Waleed"; // b[1] = "Ali"; // b[2] = "Hasnain"; // b[3] = "Usama"; //
Image of page 1
Image of page 2

You've reached the end of your free preview.

Want to read both pages?

  • Spring '17
  • Ijlal

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture