We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 94541f2 commit 710971fCopy full SHA for 710971f
Kosegenibir.java
@@ -0,0 +1,26 @@
1
+package com.company;
2
+
3
+import java.util.Scanner;
4
5
+public class Kosegenibir {
6
+ public static void main(String args[]){
7
+ Scanner scanner = new Scanner(System.in);
8
+ System.out.print("Sayı Giriniz: ");
9
+ int sayi = scanner.nextInt();
10
+ if(sayi >= 2){
11
+ int[][] dizi = new int[sayi][sayi];
12
+ for(int i = 0; i<sayi; i++){
13
+ dizi[i][i] = 1;
14
+ }
15
16
+ for(int a = 0; a < sayi; a++){
17
+ for(int b = 0; b < sayi; b++){
18
+ System.out.print(dizi[a][b]+" ");
19
20
+ System.out.println("");
21
22
+ }else{
23
+ System.out.println("Sayı 1'den büyük olmalıdır.");
24
25
26
+}
0 commit comments