C Language: Required to follow the test results of the level output percentile score section, the grade of grades by the keyboard input.

Source: Internet
Author: User

Request according to test grade grade output percentile score section,a and so on above,B and so on 70~84 points, C and other for 60~69 ,D and so on for the following points. The grade of the grade is entered by the keyboard.

Solution: Program:

#include <stdio.h>

int main ()

{

char grade;

printf ("Please enter a grade:");

scanf ("%c", &grade);

printf ("Your score segment is:");

Switch (grade)

{

Case ' A ':p rintf ("85~100\n");

Break

Case ' B ':p rintf ("70~84\n");

Break

Case ' C ':p rintf ("60~69\n");

Break

Case ' D ':p rintf ("<60\n");

Break

default:printf ("Input grade level is wrong!") \ n ");

Break

}

return 0;

}


Results:

Please enter a grade:a

Your score segment is:85~100

Please press any key to continue ...


This article is from the "Rock Owl" blog, please be sure to keep this source http://yaoyaolx.blog.51cto.com/10732111/1741407

C Language: Required to follow the test results of the level output percentile score section, the grade of grades by the keyboard input.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.