CS Knowledge Opener - Logo
CS Knowledge
Opener
Facebook Youtube Telegram
  • Home
  • 12th CS
    • 12th CS English Medium
    • 12th CS Tamil Medium
  • 12th CA
    • 12th CA English Medium
    • 12th CA Tamil Medium
  • 11th CS
    • 11th CS English Medium
    • 11th CS Tamil Medium
  • 11th CA
    • 11th CA English Medium
    • 11th CA Tamil Medium
  • CS / CA Question Bank
  • Other Subjects
  • Student Alerts
  • Govt Exams
  • Home
  • 12th CS
    • 12th CS English Medium
    • 12th CS Tamil Medium
  • 12th CA
    • 12th CA English Medium
    • 12th CA Tamil Medium
  • 11th CS
    • 11th CS English Medium
    • 11th CS Tamil Medium
  • 11th CA
    • 11th CA English Medium
    • 11th CA Tamil Medium
  • CS / CA Question Bank
  • Other Subjects
  • Student Alerts
  • Govt Exams
CS Knowledge Opener - Logo
CS Knowledge
Opener
Facebook Youtube Telegram
  • Home
  • 12th CS
    • 12th CS English Medium
    • 12th CS Tamil Medium
  • 12th CA
    • 12th CA English Medium
    • 12th CA Tamil Medium
  • 11th CS
    • 11th CS English Medium
    • 11th CS Tamil Medium
  • 11th CA
    • 11th CA English Medium
    • 11th CA Tamil Medium
  • CS / CA Question Bank
  • Other Subjects
  • Student Alerts
  • Govt Exams
  • Home
  • 12th CS
    • 12th CS English Medium
    • 12th CS Tamil Medium
  • 12th CA
    • 12th CA English Medium
    • 12th CA Tamil Medium
  • 11th CS
    • 11th CS English Medium
    • 11th CS Tamil Medium
  • 11th CA
    • 11th CA English Medium
    • 11th CA Tamil Medium
  • CS / CA Question Bank
  • Other Subjects
  • Student Alerts
  • Govt Exams
11th CS English Medium

Practical Program Exercise 2 Percentage for 11th Computer Science

Baskaran J
February 1, 2023 One Min Read
2.2K Views
0 Comments

Switch statement

  • The switch statement is a multi-way branch statement.
  • It provides an easy way to dispatch execution to different parts of code based on the value of the expression.
  • The switch statement replaces multiple if-else sequence.

CS2 – PERCENTAGE

QUESTION:

Write a C++ program to check percentage of a student and display the division (distinction, first, second, third or fail) scored using switch case

Percentage                                            Division

>=80                                                     Distinction

>=60 and <80                                       First division

>=50 and <60                                       Second Division

>=40 and <50                                       Third Division

<40                                                        Fail

AIM:

To write a C++ program to check percentage of a student and display the division scored using switch case.

CODING:

#include<iostream>

using namespace std;

int main()

{

float percent;

int x;

cout<<“Enter your percentage:”;

cin>>percent;

cout<<“You Scored”<<percent<<“%”<<endl;

x=percent/10;

switch(x)

{

case 10:

case 9:

case 8:

cout<<“You have passed with Distinction”;

break;

case 7:

case 6:

cout<<“You have passed with First Division”;

break;

case 5:

cout<<“You have passed with Second Division”;

break;

case 4:

cout<<“You have passed with Third Division”;

break;

default:

cout<<“Sorry: You have failed”;

}

return 0;

}

OUTPUT 1:

Enter your percentage:79

You Scored 79%

You have passed with First Division

OUTPUT 2:

Enter your percentage:39

You Scored 39%

Sorry: You have failed

RESULT:

The Output was verified successfully

Tags:

Practical

Share Article

Follow Me Written By

Baskaran J

Other Articles

Previous

Practical Program Exercise 1 Gross Salary for 11th Computer Science

Next

Time management in 11th & 12th CS – CA for public exam 2023 (TNBOARD)

Next
February 6, 2023

Time management in 11th & 12th CS – CA for public exam 2023 (TNBOARD)

Previous
February 1, 2023

Practical Program Exercise 1 Gross Salary for 11th Computer Science

No Comment! Be the first one.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

15 + eighteen =

Related Posts

11th CS Board Exam Answer Key Discussion 2024-2025

Baskaran J
March 14, 2025

11th Computer Science Practice One marks question 2024-2025

Baskaran J
February 3, 2025

11th Computer Science English medium Public Exam Important Important Question 2024-2025

Baskaran J
January 17, 2025

11th computer science English medium new study material 2024-2025

Baskaran J
November 1, 2024

Subscribe to our newsletter and stay updated.

CS Knowledge Opener

CS Knowledge Opener focuses on 11th &12th Computer Science & Computer Applications English Medium & Tamil Medium. Programming Skills and also we are Publishing Study Materials Based on New syllabus introduced by TNSCERT. (TNBOARD).

Quick Links

  • Contact Us
  • About Us
  • Privacy Policy
  • Disclaimer
  • Terms and Conditions
Categories
11th CA English Medium 15
11th CA Tamil Medium 9
11th CS English Medium 21
11th CS Tamil Medium 12
12th CA English Medium 32
12th CA Tamil Medium 8
12th CS English Medium 36
12th CS Tamil Medium 12
Government Exams 36
Notifications 8
Other Subjects 13

Follow Us

Youtube
Facebook
Telegram
CS Knowledge Opener © 2020 - 2025. All Rights Reserved.