โ Back to If Statements
Question 267
Grade to GPA
Grade to GPA
Read a letter grade character (A,B,C,D, orF) withscanfand 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 inputAthe output is4.0; forCit is2.0; forFit is0.0.
Expected Output:
4.0
Topics:
If Statements
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.