Last active
December 15, 2023 11:49
-
-
Save abdullahainun/4ea081bab8daa771fca1cad4bc1c4593 to your computer and use it in GitHub Desktop.
Revisions
-
abdullahainun renamed this gist
Dec 15, 2023 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
abdullahainun created this gist
Dec 15, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ #include <stdio.h> int main(void) { printf("## Program Bahasa C Persegi Angka ## \n"); printf("====================================== \n\n"); int besar_persegi,baris,kolom, i,j; printf("Input besar persegi: "); scanf("%d",&besar_persegi); printf("\n"); for(baris=1; baris<=besar_persegi; baris++) { if (baris % 2 == 0) { for(kolom=besar_persegi; kolom>=1; kolom--) { printf(" %d", kolom); } }else{ for(kolom=0; kolom<=besar_persegi-1; kolom++) { printf(" %d", kolom); } } printf("\n"); } return 0; }