Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
C_141210_Tartaglia
//Title of this code #include <stdio.h> void imprimirTrianguloTartaglia(short nf); void imprimirFilaTartaglia(short f); long binomioNewton(short m, short n); long factorial(short n); int main(void) { short numeroFilas; printf("?Cuántas filas quieres que tenga el triángulo ...? "); scanf(" %hd", &numeroFilas); imprimirTrianguloTartaglia(numeroFilas); return 0; } void imprimirTrianguloTartaglia(short nf) { short i; for(i = 0 ; i <= nf ; i++) { imprimirFilaTartaglia(i); printf("\n"); } return; } void imprimirFilaTartaglia(short f) { short i; for(i = 0 ; i <= f ; i++) { printf("%8ld", binomioNewton(f, i)); } return; } long binomioNewton(short m, short n) { return factorial(m) / (factorial(n) * factorial(m - n)); } long factorial(short n) { long F = 1; while(n) F *= n--; return F; }
run
|
edit
|
history
|
help
0
fgets and basic string manipulation
A_141205_CADENAS
Assignment 4
tst2.c
square pyramid
Conflito de Escrita em Matriz
Lab6 v0.5 Sin,cos,tan,cot
first C code
Project 5 v.06
Rotación matriz anti horaria