(@courosa) Kids should learn to code…

4779d11b6a2f4a5af1357c1994818927_normal.jpeg Alec Couros (@courosa)
2013-02-26 5:42 PM
“What most schools don’t teach” #coding #programming #edtech #etmooc bit.ly/Wp6FzH
#include <stdio.h> long factorial(int); int main() { int i, n, c; printf("Enter the number of rows you wish to see in pascal trianglen"); scanf("%d",&n); for ( i = 0 ; i < n ; i++ ) { for ( c = 0 ; c <= ( n - i - 2 ) ; c++ ) printf(" "); for( c = 0 ; c <= i ; c++ ) printf("%ld ",factorial(i)/(factorial(c)*factorial(i-c))); printf("n"); } return 0; } long factorial(int n) { int c; long result = 1; for( c = 1 ; c <= n ; c++ ) result = result*c; return ( result ); }



			

Leave a constructive reply...

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s