0% found this document useful (0 votes)
6 views2 pages

Class 9 Computer Notes

The document provides notes for Class 9 Computer Science focusing on Selection Statements, including types such as If, If-else, If-else-if ladder, Switch statements, and Ternary Operators. It includes definitions and examples for each type, illustrating their usage in programming. The document concludes with a note that more information will be provided soon.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

Class 9 Computer Notes

The document provides notes for Class 9 Computer Science focusing on Selection Statements, including types such as If, If-else, If-else-if ladder, Switch statements, and Ternary Operators. It includes definitions and examples for each type, illustrating their usage in programming. The document concludes with a note that more information will be provided soon.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Class 9 Computer Notes

Selection Statements
General Definition: Statements that can be used to apply conditions in a
program during its execution are called Selection Statements.
Types-
If statement
If-else statement
If-else-if ladder
Switch statement
Ternary Operator
If Statement: Holds one condition on which it will provide an output if
condition becomes true.
If-else Statement: Also holds one output but if the result is false it will perform
task written in the else statement.
If-else-if Ladder: It is used to apply more than one condition in an program.
Switch Case Statements: Can be used choose between multiple option given
by the computer.
Ternary Operator: Can be classified as short version of if statement which can
be written in only one line.
Examples:
If Statement
WAP to print “OK” if the user is above the age of 18.
If-else Statement
WAP to print the eligibility of user to vote(i.e. to print yes/no after checking
user’s age.)
If-else-if Ladder
WAP to print the largest of three numbers.
Switch Case Statement
Write a menu driven program for performing addition on 1, subtraction on 2,
Multiplication on 3 and Division on 4
Ternary Operator
Without using if-else WAP to check whether the user is eligible to vote or not.

IN THIS WE PROVIDE NOTES FOR CLASS 9 ON COMPUTER


More Notes will be provided
Soon…….

Thank You

You might also like