హాఫ్ పిరమిడ్ *
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
విలోమ సగం పిరమిడ్ *
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 * * * * * * * * * * * * * * *
పూర్తి పిరమిడ్ *
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 * * * * * * * * * * * * * * * * * * * * * * * * *
సంఖ్యల పూర్తి పిరమిడ్
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
విలోమ పూర్తి పిరమిడ్ *
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 ని ఎలా ఇన్స్టాల్ చేయాలి
Linux - curvedns ని ఎలా ఇన్స్టాల్ చేయాలి
Python - సంఖ్య సానుకూలంగా ఉందా, ప్రతికూలంగా ఉందా లేదా 0 అని తనిఖీ చేయండి
Linux - zenmap ని ఎలా ఇన్స్టాల్ చేయాలి
C - పూర్ణాంకంలో అంకెల సంఖ్యను లెక్కించండి
C++ - లీప్ ఇయర్ని తనిఖీ చేయండి
JavaScript - స్ట్రింగ్ కొన్ని అక్షరాలతో ప్రారంభమై ముగుస్తుందో లేదో తనిఖీ చేయండి
C++ - సంఖ్య ప్రధానమైనదా కాదా అని తనిఖీ చేయండి
C - డైనమిక్ మెమరీ కేటాయింపును ఉపయోగించి అతిపెద్ద సంఖ్యను కనుగొనండి
Kotlin - ఒక సంఖ్యను n దశాంశ స్థానాలకు రౌండ్ చేయండి
Kotlin - ఒక సంఖ్యను రివర్స్ చేయండి
Linux - xbitmaps ని ఎలా ఇన్స్టాల్ చేయాలి
Linux - zstd ని ఎలా ఇన్స్టాల్ చేయాలి
Java - ఒక సంఖ్యను రివర్స్ చేయండి
Linux - zfs-test ని ఎలా ఇన్స్టాల్ చేయాలి
Python - Excel (XLSX) ఫైల్లను వ్రాయడం
C++ - కోషెంట్ మరియు రిమైండర్ను కనుగొనండి
Linux - zookeeper-bin ని ఎలా ఇన్స్టాల్ చేయాలి
We have been online since 2021 and 1 millions of people around the globe have visited our website since then
More visitors every month