Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
B_141205_funciones
//Title of this code #include <stdio.h> long factorial(short n); short mcd(short x, short y); void cuadrado(short x); int main(void) { long F; short N; short a, b; printf("Valor de a... "); scanf(" %hd", &a); printf("Valor de b... "); scanf(" %hd", &b); for(N = 0 ; N < 20 ; N++) { printf("El factorial de %3hd es %25ld\n", N, factorial(N)); } printf("El MCD de %hd y %hd es %hd\n", a, b, mcd(a, b)); printf("El cuadrado de %hd es...", a); cuadrado(a); return 0; } long factorial(short n) { long F = 1; while(n) F *= n--; return F; } short mcd(short x, short y) { short aux; while(y) { aux = x; x = y; y = aux % y; } return x; } void cuadrado(short x) { printf("%ld", (long)x * x); }
run
|
edit
|
history
|
help
0
Project 4 v0.1
Welcome1
test
What happens if you do a system() in rextester...
19_1_7
A_141212_HistoriaDePunteros
Lab 9 v0.9
WAP in C to delete an element from an array
LinkedListTest
recurtion