Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
To input a student's numeric score and print a letter grade
SUBMITTED BY:
Guest
DATE:
Oct. 12, 2013, 2:07 a.m.
FORMAT:
C++
SIZE:
579 Bytes
Raw
Download
Tweet
HITS:
1422
Go to comments
Report
#include
<stdio.h>
int
main
()
{
int
score
;
printf
(
"
\n
Please enter a numeric score : "
);
scanf_s
(
"%d"
,
&
score
);
if
(
score
>=
90
)
{
printf
(
"
\n
Your grade is an A."
);
}
else
if
(
score
>=
80
)
{
printf
(
"
\n
Your grade is a B."
);
}
else
if
(
score
>=
70
)
{
printf
(
"
\n
Your grade is a C."
);
}
else
if
(
score
>=
60
)
{
printf
(
"
\n
Your grade is a D."
);
}
else
{
printf
(
"
\n
Your grade is an F."
);
}
getchar
();
getchar
();
return
0
;
}
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus