Thursday, April 8, 2021

ICSE COMPUTER SCIENCE SPECIMEN PAPER | QUESTION 7 | PLEASE DO WATCH THE VIDEO

 





import java.util.*;

class icse_specimen_1
{
    public static void main(String[] args)
    {
        Scanner sc1 = new Scanner(System.in);
        int a[] = new int[10];
        System.out.println("Please enter array values");
        for(int i=0;i<10;i++)
        {
            a[i] = sc1.nextInt();
        }
        int temp=0;
        for(int j=0;j<10;j++)
        {   
            for(int k=0;k<10;k++)
            {
                if(a[j]>a[k])
                {
                    temp=a[k];
                    a[k]=a[j];
                    a[j]=temp;
                }
            }
        }
        System.out.println("Max Number "+a[0]);
        System.out.println("Min Number "+a[9]);
        
        
    }
}

No comments:

Post a Comment

ICSE COMPUTER SCIENCE SPECIMEN PAPER | QUESTION 7 | PLEASE DO WATCH THE VIDEO

  import  java.util.*; class icse_specimen_1 {     public static void main(String[] args)     {         Scanner sc1 = new Scanner(System.in)...