Yarım Piramit *
C
xxxxxxxxxx
int main() {
int i, j, rows;
printf("Enter the number of rows: ");
scanf("%d", &rows);
for (i = 1; i <= rows; ++i) {
for (j = 1; j <= i; ++j) {
printf("* ");
}
printf("\n");
}
return 0;
}
Enter the number of rows: 5 * * * * * * * * * * * * * * *
C
xxxxxxxxxx
int main() {
int i, j, rows;
printf("Enter the number of rows: ");
scanf("%d", &rows);
for (i = 1; i <= rows; ++i) {
for (j = 1; j <= i; ++j) {
printf("%d ", j);
}
printf("\n");
}
return 0;
}
Enter the number of rows: 5 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5
Ters yarım piramit *
C
xxxxxxxxxx
int main() {
int i, j, rows;
printf("Enter the number of rows: ");
scanf("%d", &rows);
for (i = rows; i >= 1; --i) {
for (j = 1; j <= i; ++j) {
printf("* ");
}
printf("\n");
}
return 0;
}
Enter the number of rows: 5 * * * * * * * * * * * * * * *
Tam Piramit *
C
xxxxxxxxxx
int main() {
int i, space, rows, k = 0;
printf("Enter the number of rows: ");
scanf("%d", &rows);
for (i = 1; i <= rows; ++i, k = 0) {
for (space = 1; space <= rows - i; ++space) {
printf(" ");
}
while (k != 2 * i - 1) {
printf("* ");
++k;
}
printf("\n");
}
return 0;
}
Enter the number of rows: 5 * * * * * * * * * * * * * * * * * * * * * * * * *
Sayıların Tam Piramidi
C
xxxxxxxxxx
int main() {
int i, space, rows, k = 0, count = 0, count1 = 0;
printf("Enter the number of rows: ");
scanf("%d", &rows);
for (i = 1; i <= rows; ++i) {
for (space = 1; space <= rows - i; ++space) {
printf(" ");
++count;
}
while (k != 2 * i - 1) {
if (count <= rows - 1) {
printf("%d ", i + k);
++count;
} else {
++count1;
printf("%d ", (i + k - 2 * count1));
}
++k;
}
count1 = count = k = 0;
printf("\n");
}
return 0;
}
1 2 3 2 3 4 5 4 3 4 5 6 7 6 5 4 5 6 7 8 9 8 7 6 5
Ters tam piramit *
C
xxxxxxxxxx
int main() {
int rows, i, j, space;
printf("Enter the number of rows: ");
scanf("%d", &rows);
for (i = rows; i >= 1; --i) {
for (space = 0; space < rows - i; ++space)
printf(" ");
for (j = i; j <= 2 * i - 1; ++j)
printf("* ");
for (j = 0; j < i - 1; ++j)
printf("* ");
printf("\n");
}
return 0;
}
Enter the number of rows: 5 * * * * * * * * * * * * * * * * * * * * * * * * *
Linux - anc-api-tools nasıl kurulur
Linux - curvedns nasıl kurulur
Python - Bir Sayının Pozitif, Negatif veya 0 olup olmadığını kontrol edin
Linux - zenmap nasıl kurulur
C - Bir Tam Sayıda Basamak Sayısı
C++ - Artık Yılı Kontrol Edin
JavaScript - Bir Dizenin Belirli Karakterlerle Başlayıp Bitmediğini Kontrol Edin
C++ - Bir Sayının Asal Olup Olmadığını Kontrol Edin
C - Dinamik Bellek Tahsisi Kullanarak En Büyük Sayıyı Bulun
Kotlin - Bir Sayıyı n Ondalık Basamağa Yuvarlama
Kotlin - Bir Sayıyı Ters Çevir
Linux - xbitmaps nasıl kurulur
Linux - zstd nasıl kurulur
Linux - zfs-test nasıl kurulur
Java - Bir Sayıyı Ters Çevir
Python - Excel (XLSX) Dosyaları Yazma
C++ - Bölüm ve Kalanı Bul
Linux - zookeeper-bin nasıl kurulur
We have been online since 2021 and 1 millions of people around the globe have visited our website since then
More visitors every month