Last active
December 14, 2015 21:19
-
-
Save onnyyonn/5150266 to your computer and use it in GitHub Desktop.
Print up to 34th Catalan no.
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() | |
{ | |
float n=0.0, cat=1.0; | |
while(n<=33) | |
{ | |
cat = 2*(2*n+1)/(n+2)*cat; | |
n++; | |
printf("Catalan no. %2.0f is %1.0f\n",n,cat); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment