Skip to content

Instantly share code, notes, and snippets.

@sumtyme
Created April 25, 2012 18:01
Show Gist options
  • Save sumtyme/2491712 to your computer and use it in GitHub Desktop.
Save sumtyme/2491712 to your computer and use it in GitHub Desktop.
main()
{
char first_letter;
int test_one;
int test_two;
float test_three;
float avg;
first_letter = 'A';
test_one = 0;
test_two = 0;
test_three = 0;
avg = test_one * test_two * test_three / 3;
printf("Please enter the first letter of your first name:");
scanf("%c", &first_letter);
printf("Please enter the grade for your test one:");
scanf("%d", &test_one);
printf("Please enter the grade for your test two:");
scanf("%d", &test_two);
printf("Please enter the grade for your final test:");
scanf("%f", &test_three);
printf("The student with the first letter %c", first_letter);
printf("\nTest one \tTest Two \tTest Three")
printf("\n------------------------------------------")
printf("\n%d \t\t%d \t\t%f", test_one, test_two, test_three);
printf("\n\n%f",avg);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment