Initial commit
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
#include <stdio.h>
|
||||
int main() {
|
||||
int i, j;
|
||||
|
||||
// Number of rows
|
||||
int rows = 3;
|
||||
|
||||
// Taking first character of alphabet
|
||||
// which is useful to print pattern
|
||||
char character = 'A';
|
||||
|
||||
// This loop is used to identify
|
||||
// number rows
|
||||
for (i = 0; i < rows; i++) {
|
||||
// This for loop is used to
|
||||
// identify number of columns
|
||||
// based on the rows
|
||||
for (j = 0; j <= i; j++) {
|
||||
// Printing character to get
|
||||
// the required pattern
|
||||
printf("%c ", character);
|
||||
|
||||
// Incrementing character value so
|
||||
// that it will print the next character
|
||||
character++;
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
1,2,3,4
|
||||
5,6,7,8
|
||||
|
Reference in New Issue
Block a user