0% found this document useful (0 votes)
5 views3 pages

Programas de Cálculo Numérico en C#

This document contains code snippets for several C# programs: 1) A program that finds all divisors of a user-input number. 2) Two programs that determine if each digit of a user-input number is even or odd. 3) A program that finds "perfect numbers" below 10,000. 4) A program that prints the Fibonacci sequence up to a user-input number. 5) A program that prints a border of H's with the word "BIENVENIDO" in the middle.

Uploaded by

maxrivmen19
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views3 pages

Programas de Cálculo Numérico en C#

This document contains code snippets for several C# programs: 1) A program that finds all divisors of a user-input number. 2) Two programs that determine if each digit of a user-input number is even or odd. 3) A program that finds "perfect numbers" below 10,000. 4) A program that prints the Fibonacci sequence up to a user-input number. 5) A program that prints a border of H's with the word "BIENVENIDO" in the middle.

Uploaded by

maxrivmen19
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

//DIVISORES DE UN NUMERO int N; [Link]("NUMERO:"); N = [Link]([Link]()); int I; for(I=1;I<=N;I++) { if (N%I==0) Console.

WriteLine("{0}",I); } //PAR O IMPAR LOS DIGITOS DE UN NUMERO int N; [Link]("NUMERO:"); N = [Link]([Link]()); int P,Q; do { P = N % 10; if (P % 2 == 0) [Link]("{0}:PAR", P); [Link]("{0}:IMPAR", P); Q = N / 10; N = Q; } while (P != 0); //PAR O IMPAR LOS DIGITOS DE UN NUMERO OTRA FORMA int N; [Link]("NUMERO:"); N = [Link]([Link]()); int P; while (N > 0) { P = N % 10; N = N / 10; if (P % 2 == 0) [Link]("{0}:ES PAR", P); [Link]("{0}:ES IMPAR", P); } //PROGRAMA QUE HALLA LOS NUMEROS PERFECTOS int N; N = 1; while (N < 10000) { int I, S; S = 0; for (I = 1; I <= (N - 1); I++) { if (N % I == 0)

S = S + I; } if(N==S) [Link]("{0}", S); N = N + 1; } //SERIE DE FIBONACCI int N; [Link]("NUMERO:"); N = [Link]([Link]()); int A,B,C; A=0; B=1; [Link](""); [Link]("{0}", 0); [Link]("{0}", 1); do { C = A + B; [Link]("{0}",C); A = B; B = C; N = N - 1; } while (N>2); [Link]("");

//HACER UN CUADRO DE BIENVENIDA string A,B;A="H ";B="H for (int I = 1; I < 10; I++) { [Link]("{0}", A);

H";

} for (int J = 1; J < 8; J++) { [Link](""); [Link]("{0}", B); if (J == 4) [Link](" BIENVENIDO"); } [Link](""); for (int I = 1; I < 10; I++) { [Link]("{0}", A); } [Link](""); [Link]("");

You might also like