Guruh talabasi F. I. O: Temiraliev Mujibali Juraalizoda Masala sharti


Download 269.34 Kb.
Sana20.12.2022
Hajmi269.34 Kb.
#1040731
Bog'liq
3-dedline


650-22 guruh talabasi
F.I.O: Temiraliev Mujibali Juraalizoda


Masala sharti:

N ta elementdan tashkil topgan massiv berilgan. Massiv oxirgi elementidan kichkina bo’lgan birinchi elementni chiqaruvchi dastur tuzing.


Dastur kodi:

import java.util.Scanner;


public class Main {
public static void main(String[] args) {
Scanner k = new Scanner(System.in) ;
System.out.println("n sonini kiriting: ");
int n = k.nextInt();
System.out.println("Massiv elementlarini kiriting: ");
int mas[] = new int[n];
for( int i=0; imas[i] = k.nextInt();
}
for( int i=0; iif (mas[n-1]>mas[i]){
System.out.println("oxirgi elementdan kichik bolgan birinchi son: " + mas[i]);
break;
}

else {
System.out.println("kiritilgan son exirgi elementdan katta yoki teng!");


}}
}}

Dastur natijasi:



Download 269.34 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling