Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main() {
- int r, t; // también se puede hacer con float y evito paso 10
- printf("Introduce el número total de preguntas: \n");
- scanf("%d", &t);
- printf("Introduce el número de preguntas respondidas correctamente: \n");
- scanf("%d", &r);
- float y = ((float) r)/t*100;
- if (y >= 90){
- printf("Nivel máximo");
- }
- if (y >= 75 && y < 90){
- printf("Nivel medio");
- }
- if (y >= 50 && y <75){
- printf("Nivel regular");
- }
- if (y < 50){
- printf("Fuera de nivel");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment