Se cargan por teclado tres números distintos. Mostrar por pantalla el mayor de ellos.

Hello friends technoupdatviral, on this occasion the admin wants to share an article entitled Se cargan por teclado tres números distintos. Mostrar por pantalla el mayor de ellos. , we have made good, quality and useful articles for you to read and take information in. hopefully the post content is about which we write you can understand. Alright, happy reading.

 

·         Realizar los siguientes ejercicio Estructuras condicionales anidadas

Problemas propuestos

1. Se cargan por teclado tres números distintos. Mostrar por pantalla el mayor de ellos. 

Module Module1

 

    Sub Main()

 

        Dim N1, N2, N3 As Long

 

        Console.WriteLine("Digete El Primer Numero:")

        N1 = Console.ReadLine

 

        Console.WriteLine("Digete El Segundo Numero:")

        N2 = Console.ReadLine

 

        Console.WriteLine("Digete El Tercer Numero:")

        N3 = Console.ReadLine

 

        If N1 > N2 And N1 > N3 Then

            If N2 > N3 Then

                Console.WriteLine("El numero mayor es :" & N1)

                Console.WriteLine("El numero menor es :" & N3)

                Console.ReadLine()

            Else

                Console.WriteLine("El numero mayor es :" & N1)

                Console.WriteLine("El numero menor es :" & N2)

                Console.ReadLine()

            End If

        ElseIf N2 > N1 And N2 > N3 Then

            If N1 > N3 Then

                Console.WriteLine("El numero mayor es :" & N2)

                Console.WriteLine("El numero menor es :" & N3)

                Console.ReadLine()

            Else

                Console.WriteLine("El numero mayor es :" & N2)

                Console.WriteLine("El numero menor es :" & N1)

                Console.ReadLine()

            End If

        Else

            If N2 > N1 Then

                Console.WriteLine("El numero mayor es :" & N3)

                Console.WriteLine("El numero menor es :" & N1)

                Console.ReadLine()

            Else

                Console.WriteLine("El numero mayor es :" & N3)

                Console.WriteLine("El numero menor es :" & N2)

                Console.ReadLine()

            End If

        End If

    End Sub

 

 

End Module

 

 


2. Se ingresa por teclado un valor entero, mostrar una leyenda que indique si el número es positivo, nulo o negativo. 

Public Class Form1

 

    Private SubButton1_Click(ByVal sender As System.Object,

    ByVal e As System.EventArgs) Handles Button1.Click

        Dim n As Integer

        n = TextBox1.Text

        If (n = 0) Then

            TextBox2.Text = "El numero " + Trim(n) + " es nulo"

        Else

            If (n > 0) Then

                TextBox2.Text = "El numero " + Trim(n) + " es positivo"

            Else

                TextBox2.Text = "El numero " + Trim(n) + " es negativo"

            End If

        End If

    End Sub

End Class


3. Confeccionar un programa que permita cargar un número entero positivo de hasta tres cifras y muestre un mensaje indicando si tiene 1, 2, o 3 cifras. Mostrar un mensaje de error si el número de cifras es mayor.

 

 Module Module1

 

    Sub Main()

        Dim num As Integer

 

        Console.WriteLine("Ingrese un valor de hasta tres dígitos positivo:")

        num = Console.ReadLine

        If num < 10 Then

 

            Console.WriteLine("Tiene un dígito")

        End If

 

        If num > 9 & num < 100 Then

            Console.WriteLine("Tiene dos dígitos")

        End If

 

 

        If num < 1000 Then

            Console.WriteLine("Tiene tres dígitos")

        End If

 

 

 

        Console.WriteLine("Error en la entrada de datos.")

 

        Console.ReadLine()

 

    End Sub

 

End Module

 


4. Un postulante a un empleo, realiza un test de capacitación, se obtuvo la siguiente información: cantidad total de preguntas que se le realizaron y la cantidad de preguntas que contestó correctamente. Se pide confeccionar un programa que ingrese los dos datos por teclado e informe el nivel del mismo según el porcentaje de respuestas correctas que ha obtenido, y sabiendo que:


Nivel máximo: Porcentaje>=90%.
Nivel medio: Porcentaje>=75% y <90%.
Nivel regular: Porcentaje>=50% y <75%.
Fuera de nivel: Porcentaje<50%.

 

 

Module Module1

 

    Sub Main()

        Dimtotalpreguntas, totalcorrectas As Integer

 

        Console.Write("Ingrese la cantidad total de preguntas del examen:")

        totalpreguntas = Console.ReadLine

 

        Console.Write("Ingrese la cantidad total de preguntas contestadas correctamente:")

        totalcorrectas = Console.ReadLine

 

 

        Dim porcentaje = totalcorrectas * 100 / totalpreguntas

 

        If porcentaje >= 90 Then

 

        End If

        Console.WriteLine("Nivel Maximo")

 

 

        If porcentaje >= 70 Then

 

        End If

 

        Console.WriteLine("Nivel Medio")

 

 

        If porcentaje >= 50 Then

 

        End If

 

        Console.WriteLine("Nivel Regular")

 

 

 

        Console.ReadLine()

 

 

    End Sub

 

End Module




 



That's the article: Se cargan por teclado tres números distintos. Mostrar por pantalla el mayor de ellos.
Thank you for visiting my blog, hopefully it can be useful for all of you. Don't forget to share this article with your friends so they also know the interesting info, see you in other article posts.

You are now reading the article Se cargan por teclado tres números distintos. Mostrar por pantalla el mayor de ellos. with link address https://technoupdatviral.blogspot.com/2021/06/se-cargan-por-teclado-tres-numeros.html

More Articles

Post a Comment

Previous Post Next Post

Iklan In-Feed (homepage)

" target="_blank">Responsive Advertisement

#Advertisement