Created
November 23, 2018 14:38
-
-
Save feynon/d622db6d3050aeaa2dc1a493e39ddcee to your computer and use it in GitHub Desktop.
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
/* | |
ABCDE | |
FGHI | |
JKL | |
MN | |
O | |
*/ | |
#include <stdio.h> | |
void printrecur(int n, int i) | |
{ | |
static char c='A'; | |
static int d=1; | |
if(n<1){ | |
return; | |
} | |
if(i <= n){ | |
printf("%c",c); | |
c++; | |
printrecur(n, i+1); | |
} | |
else{ | |
printf("\n"); | |
for(int i=0;i<d;i++) | |
printf(" "); | |
d++; | |
printrecur(n-1, 1); | |
} | |
} | |
int main() | |
{ | |
int n; | |
printf("Kya hai? - "); | |
scanf("%d", &n); | |
printrecur(n, 1); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
pakad liya launde ne.....