What I'm trying to do is make a C program, that gives me the final grade of a subject and depending on the number, show me a message on screen.
#include<stdio.h>
#include<conio.h>
main (){
float cal1=0, cal2=0, cal3=0, cal4=0;
float notafinal=0;
printf("Ingrese la Nota del 1er Corte: \n\n");
scanf("%f",&cal1);
printf ("Ingrese la Nota del 2do Corte: \n\n");
scanf("%f",&cal2);
printf("Ingrese la Nota del 3er Corte: \n\n");
scanf("%f",&cal3);
printf("Ingrese la Nota del 4to Corte: \n\n");
scanf("%f",&cal4);
notafinal=((cal1*0.2)+(cal2*0.2)+(cal3*0.3)+(cal4*0.4));
if (notafinal > 18){
printf ("\nYOUR A FUCKING GENIUS\n\n");
printf ("Su nota es: %f\n\n",notafinal);
}
if (notafinal > 12){
printf("\nAPROBADO\n\n");
printf("Su nota es: %f\n\n",notafinal);
}
else {
printf("\nREPROBADO\n\n");
printf("Su nota es: %f\n\n",notafinal);
}
return 0;
}
The problem is that it shows both the approved message and the message of a genius , and I want you to just put me first.
Pseudocode: I need to translate something like this but in C.
Si notafinal > 12 escribir APROBADO, SU N...
Si notafinal < 12 escribir DESAPROBADO, SU N...
Si notafinal > 18 escribir GENIO, SU N.. (SIN ESCRIBIR APROBADO, SU NOTA ES...).