Created
November 26, 2022 18:21
-
-
Save lazuee/7cc6b390955fc80472867fd32fc8043c to your computer and use it in GitHub Desktop.
Codechum - Numerical Triangle
This file contains 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 characters
#include<stdio.h> | |
int main() { | |
int n; | |
int start = 1; | |
printf("Enter n: "); | |
scanf("%d", & n); | |
for (int row = 1; start <= n; row++) { | |
for (int column = 1; column <= row; column++) { | |
printf("%d", start); | |
start++; | |
if (start > n) break; | |
} | |
printf("\n"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment