( SECTION A )
Important 2 Marks
1) Data Types :
a) Int
b) Float
c) Char
d) Double
2) array meaning :
Array in C can be defined as a method of clubbing multiple entities of similar type into a larger group. These entities or elements can be of int, float, char, or double data type or can be of user-defined data types too like structures.
3) What is Structure data type?
A structure is a keyword that creates user-defined data types in C/C++. Astructure creates a data type that can be used to group items of possibly different types intoa single type.
4) What ts varraible and data type in C?
A variable is an identifier which is used to store a value. There are four commonly used data types such as int, float, char and a void. Each data type differs in size and range from one another.
( SECTION C )
Important 10 Marks
1) Switch Statement :
Switch case statement evaluates a given expression and based on the evaluated value(matching a certain condition), it executes the statements associated with it. Basically, itis used to perform different actions based on different conditions(cases).
* Switch case statements follow a selection-control mechanism and allow a value
to change control of execution.
* They area substitute for long if statements that compare a variable to several
integral values.
* The switch statement is a multiway branch statement. It provides an easy way to
dispatch execution to different parts of code based on the value of the expression.
In C++, the switch statement is used for executing one condition from multiple
conditions. It is similar to an if-else-if ladder.
Switch statement consists of conditional based cases and a default case.
In a switch statement, the “case value” can be of “char” and “int” type. Following are some of the rules while using the switch statement:
1. There can be one or N numbers of cases.
2. The values in the case must be unique.
3. Each statement of the case can have a break statement. It is optional.
Important Points Of About Switch Statement :
1) The expression provided in the switch should result in a constant value otherwise
it would not be valid.
2) Dupilicate Case Values are not allowed.
3) The default statement is optional. Even if the switch case statement do not have a default statement,it would run without any problem.
4) The break statement is used inside the switch to terminate a statement
sequence. When a break statement is reached, the switch terminates, and the flow of
control jumps to the next line following the switch statement.
5) The break statement is optional. If omitted, execution will continue on into the
next case. The flow of control will fall through to subsequent cases until a break is reached.
6) Nesting of switch statements is allowed, which means you can have switch
statements inside another switch. However nested switch statements should be avoided as it makes the program more complex and less readable.
7) Switch statements are limited to integer values and characters only in the check condition.
