C

Fundamental concept of Problem solving
Introduction
Problem solving strategies
Program design & implementation
Introduction to C
Introduction to C
How to open C program code window
Description of C code window
Editing File
Saving and Running a program
The components of C language
Structure of C Program
A sample of C language program
C character set and keywords
C character set and keywords
The C character set
Identifiers
Key words
Data Types
Data Types
Primary Data Type
Secondary Data Type
Variables
Introduction
Rules for constructing variables names
Variable declaration
Assigning values to variables
Scope of variables: Local & Global
Constants
Introduction
Character constants
Integer constants
Real constants
Logical & String constants
C instruction set
Introduction
Type Declaration & Input/Output Instructions
Arithmetic Instructions
Control Instructions
Operators
Introduction
Arithmetic operators
Relational operators
Logical operators
Increment & Decrement operators
Bitwise operators
Conditional & ternary operators
The comma operators
Size of operator
Assignment operator
Type modifier
Expressions
Evaluation of expression
Automatic type conversion
Basic Input/Output
Introduction
Console I/O function
Disc & Port I/O function
Control Structures
Sequence control statements
Decision control & conditional statements
Case control statements
Repitition & loop control statements
Some more statements
Array and String
Introduction of Array
Array Declaration
Array Initialization
Two Dimensional Array
Multi Dimensional Array
String
Function and Recursion
Function Definition
Function Declaration
Function Call
Recursion
Pointers
Introduction
Pointer expression
Pointer & functions
Pointer & Array
Multi Dimensional Arrays & Pointer
Arrays of Pointer
Use of Pointer & functions
Structures
Introduction
Giving values to member
Structure Initialization
Comparison of structure variables
Arrays of structures
Arrays within structures
Structures within structures
Passing structure to function
Union
Introduction
Accessing a union member
Initialization of Union variable
Uses of Union
Dynamic Data Structure
Linked list
Stack
Queue
Data File Handling through C
Introduction
File operation
Opening & closing a data file
Creating a data file
Processing a data file
Unformatted data file
C Preprocessor & Macro
Introduction
Macro substitution directives
File inclusion
Compiler control directive
Command line parameter of C
Command line parameter
Header file
Header file
Use of library functions
Some Useful library functions

Control Structures


Case control statements

The Case control statements allow the computer to take decision as to be which statements are to be executed next. It is a multi way decision construct facilitate number of alternatives.
 
C has multi way decision statement known as switch statements. It tests the value of a given variable or expression against a list of case value and when a match found a block of statement associated with the case is executed.
 
Syntax of switch statement:
 
switch(expression)
{
case constant_1:
statements;
case constant_2:
statements;
case constant_n:
statements;
default:
statements;
}
 
Explanation:
 
First in expression parentheses we give the condition.
This condition checks to match, one by one with case constant.
If value match then its statement will be executed. Otherwise the default statement will appear.
 
A structure image of switch statements>
 
 
An example program to check whether a given number is even or odd, using switch statements:
 
 
Out put of the program
 
 
Explanation of the program:
 
First you will be asked to enter any number
Suppose you enter 7
 
Now the given condition check, so the modulus is 0 or not. (% operator is use to find out the remainder)
 
if the modulus is 0 then ch=1 otherwise 2, statement will be execute.