CJCoding With Joseph

Grade to GPA

Read a letter grade character (A, B, C, D, or F) with scanf and print the matching GPA to one decimal place using %.1f, with no trailing newline:

A -> 4.0, B -> 3.0, C -> 2.0, D -> 1.0, F -> 0.0.

For input A the output is 4.0; for C it is 2.0; for F it is 0.0.

Expected Output:

4.0
Topics:
If Statements
๐Ÿ“ฅ Auto-Input:
A\n
This input is automatically fed to your program's stdin
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (p, fori)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.