Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int[] grades=new int[10];
- int i = 1;
- Scanner scan=new Scanner(System.in);
- System.out.println("please enter grades");
- grades[0]=scan.nextInt();
- int big = grades[0];
- int small = grades[0];
- while(i<10)
- {
- grades[i]=scan.nextInt();
- if(grades[i]>big){
- big=grades[i];
- }
- if(grades[i]<small){
- small=grades[i];
- }
- i++;
- }
- scan.close();
- System.out.println("the big is "+big);
- System.out.println("the small is "+small);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement