Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- /*int main()
- {
- int sueldo;
- printf("Ingrese un sueldo: ");
- scanf("%d", &sueldo);
- if (sueldo > 3000) {
- printf("\nDebe abonar impuestos\n");
- };
- //printf("Hello world!\n");
- return 0;
- }
- */
- /* int main ()
- {
- int num1, num2;
- printf("Ingrese un numero: ");
- scanf("%d", &num1);
- printf("Ingrese otro numero: ");
- scanf("%d", &num2);
- if (num1 > num2)
- {
- printf("El primer numero es el mayor: %d", num1);
- }
- else
- {
- printf("El segundo numero es el mayor: %d", num2);
- }
- return 0;
- } */
- /* int main ()
- {
- int numero;
- printf("Ingrese un numero entero positivo entre 1 y 99: ");
- scanf("%d", &numero);
- if (numero < 1 || numero > 99)
- {
- printf("El numero no esta entre 1 y 99");
- }
- else if (numero < 10 )
- {
- printf("El numero tiene una sola cifra");
- }
- else
- {
- printf("El numero tiene dos cifras");
- }
- return 0;
- } */
- /* Confeccionar un programa que pida por teclado tres notas de un alumno, calcule el promedio e imprima alguno de estos mensajes:
- Si el promedio es >=7 mostrar "Promocionado".
- Si el promedio es >=4 y <7 mostrar "Regular".
- Si el promedio es <4 mostrar "Reprobado". */
- /* int main ()
- {
- int nota1, nota2, nota3;
- float promedio;
- printf("Ingrese las 3 notas del alumno\n");
- printf("Nota 1: ");
- scanf("%d", ¬a1);
- printf("Nota 2: ");
- scanf("%d", ¬a2);
- printf("Nota 3: ");
- scanf("%d", ¬a3);
- promedio = (nota1 + nota2 + nota3) / 3;
- if (promedio < 4)
- {
- printf("Reprobado");
- }
- else
- {
- if (promedio < 7)
- printf("Regular");
- else
- {
- printf("Promocionado");
- }
- }
- return 0;
- } */
- /* int main ()
- {
- int num1, num2, num3;
- printf("Ingrese el numero 1: ");
- scanf("%d", &num1);
- printf("Ingrese el numero 2: ");
- scanf("%d", &num2);
- printf("Ingrese el numero 3: ");
- scanf("%d", &num3);
- if (num1 > num2)
- {
- if (num1 > num3)
- {
- printf("El numero mayor es: %d", num1);
- }
- }
- else
- {
- if (num2 > num3)
- {
- printf("El numero mayor es: %d", num2);
- }
- else
- {
- printf("El numero mayor es: %d", num3);
- }
- }
- return 0;
- } */
- /* 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%. */
- int main()
- {
- int preguntas, resCorrectas;
- float porcentaje;
- printf("Cantidad de preguntas totales: ");
- scanf("%d", &preguntas);
- printf("Cantidad de respuestas correctas: ");
- scanf("%d", &resCorrectas);
- porcentaje = resCorrectas * 100 / preguntas ;
- if (porcentaje >= 90)
- {
- printf("Nivel maximo: %.2f", porcentaje);
- }
- else
- {
- if (porcentaje >= 75)
- {
- printf("Nivel medio: %.2f", porcentaje);
- }
- else if (porcentaje >= 50)
- {
- printf("Nivel regular: %.2f", porcentaje);
- }
- else
- {
- printf("Fuera de nivel: %.2f", porcentaje);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement