0% found this document useful (0 votes)
9 views

programa Uno: Console Console Console Console Console

The document contains code for 4 programs. Program 1 asks the user to input number of rows and a number to repeat, then prints the number in increasing rows. Program 2 does the same but in decreasing rows. Program 3 prints the number in increasing then decreasing rows. Program 4 finds the number of digits in a user input number by increasing the power of 10 until it is greater than the number.

Uploaded by

maxrivmen19
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

programa Uno: Console Console Console Console Console

The document contains code for 4 programs. Program 1 asks the user to input number of rows and a number to repeat, then prints the number in increasing rows. Program 2 does the same but in decreasing rows. Program 3 prints the number in increasing then decreasing rows. Program 4 finds the number of digits in a user input number by increasing the power of 10 until it is greater than the number.

Uploaded by

maxrivmen19
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

//PROGRAMA UNO int N1, N2, X, Y; Console.Write("Igrese numero de filas:"); N1 = int.Parse(Console.ReadLine()); Console.Write("Ingrese numero a repetir:"); N2 = int.Parse(Console.ReadLine()); Console.

WriteLine(""); for (X = 1; X <= N1; X++) { for (Y = 1; Y <= X; Y++) { Console.Write("{0}", N2); } Console.WriteLine(""); } Console.WriteLine(""); //PROGRAMA DOS int N3, N4, P, Q; Console.Write("Igrese numero de filas:"); N3 = int.Parse(Console.ReadLine()); Console.Write("Ingrese numero a repetir:"); N4 = int.Parse(Console.ReadLine()); Console.WriteLine(""); for (P = N3; P >= 0; P--) { for (Q = 1; Q <= P; Q++) { Console.Write("{0}", N4); } Console.WriteLine(""); } Console.WriteLine(""); //PROGRAMA TRES int N5, N6, T, U; Console.Write("Igrese numero de filas:"); N5 = int.Parse(Console.ReadLine()); Console.Write("Ingrese numero a repetir:"); N6 = int.Parse(Console.ReadLine()); Console.WriteLine(""); for (T = 1; T <= N5; T++) { for (U = 1; U <= T; U++) { Console.Write("{0}", N6); } Console.WriteLine(""); } for (T = (N5-1); T >= 0; T--) { for (U = 1; U <= T; U++) { Console.Write("{0}", N6); } Console.WriteLine(""); }

Console.WriteLine(""); //PROGRAMA 4 int N7, I, J; Console.Write("Ingrese numero:"); N7 = int.Parse(Console.ReadLine()); I=1; for ( J = (10 ^ I); N7 < J; I=I+1) { Console.Write("El numero de digitos es : {0}", I); }

You might also like