Created
May 22, 2013 13:33
-
-
Save ahoulgrave/5627565 to your computer and use it in GitHub Desktop.
Grados de notas
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdlib> | |
#include <iostream> | |
using namespace std; | |
int main(int argc, char *argv[]) | |
{ | |
float nota; | |
char grado[1]; | |
printf("Ingrese la nota:\n"); | |
scanf("%f",¬a); | |
if (nota <= 2) { | |
strcpy(grado,"A"); | |
} else if (nota < 6) { | |
strcpy(grado,"B"); | |
} else if (nota <= 8) { | |
strcpy(grado,"C"); | |
} else if (nota > 8) { | |
strcpy(grado,"D"); | |
} else { | |
strcpy(grado,"F"); | |
} | |
printf("\nGrado: %s\n\n",grado); | |
system("PAUSE"); | |
return EXIT_SUCCESS; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment