Skip to content

Instantly share code, notes, and snippets.

@ahoulgrave
Created May 22, 2013 13:33
Show Gist options
  • Save ahoulgrave/5627565 to your computer and use it in GitHub Desktop.
Save ahoulgrave/5627565 to your computer and use it in GitHub Desktop.
Grados de notas
#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",&nota);
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