You are on page 1of 3

CP-100 COMPUTER PRORAMMING

MODULE-1 (REVISION)
INTRODUCTION TO C LANGUAGE - PRE-PROCESSOR DIRECTIVES,
HEADER FILES, DATA TYPES AND QUALIFIERS. OPERATORS AND
EXPRESSIONS. DATA INPUT AND OUTPUT, CONTROL STATEMENTS.

INTRODUCTION TO C LANGUAGE

 Introduction to C
 History of C Programming Language
 Structure with diagram
 Compilation process with diagram
 Rules for writing a C program
 C Tokens and Keywords
o Six types of tokens
o Identifiers and rules

PRE-PROCESSOR DIRECTIVES

 Definition
 Two types
o Macros
 Definition
 Example
o Header files
 Two Categories
 Programmer defined
 Comes with compiler
o Different header files and functions
 # include<stdio.h>
 # include<conio.h>
 # include<math.h>
 # include<string.h>
 # include<time.h>
 Advantages of using pre-processor directives

C DATA TYPES

 Two categories
1. Fundamental data type (keyword, size, eg.)
 Integer
 Floating
 Character
2. Derived Data type
 Array
 Structure
 Pointer
 Enumerated
 Definition
 Example

C QUALIFIER

 Two types
1. Const
 Definition
 Syntax
 Example
2. Volatile
 Definition
 Syntax
 Example

OPERATORS AND EXPRESSIONS

 Different type of operators

1. Arithmetic Operators (+, -, /, *,%)


2. Relational Operators (< <=, >, >=, !=, ==)
3. Logical Operators (&&, ||, !)
4. Bitwise Operators (&, |, ^,~,<<, >>)
5. Assignment Operators(=,+=, -=, /=, *=,%=, &=, |=, ^=,<<=, >>=)
6. Increment/Decrement Operator(i++, i--, ++i, --i)
7. Misc Operators
 Four types
 & (Address Operator)
 * (Pointer to a variable)
 sizeof()- to find the size/memory space of a variable
 ?:(ternary/conditional)

DATA INPUT AND OUTPUT

 Definition
 Commonly used input and output function
1. scanf() with example
 definition
 syntax
 format specifiers
 conversion characters
2. printf() with example
3. getchar() and putchar() with example
4. gets() and puts() with example
5. getch() and getche() with example

CONTROL STATEMENTS

 Definition
 Four types
1. Decision statements
 Definition
 Three types (Definition, General Format, Flowchart, eg.)
I. If
II. If..else
III. If..elseif...else
2. Selection statements
 Definition
 Switch statement
I. General format
II. Flow chart
III. example
3. Iteration statements
 Definition
 Three types (Definition, General Format, Flowchart, eg.)
I. while()
II. do..while()
III. for()
 Different between while() and do..while()
4. Jump Statement
 Definition
 Three types(Definition, General Format, Flowchart, eg.)
I. break
II. continue
III. goto

You might also like