Sei sulla pagina 1di 15

C PROGRAMMING

WHAT IS A PROGRAM ?
WHAT IS A PROGRAMMING LANGUAGE ?
DATA TYPES ?
OPERATORS ?
TYPE CONVERSIONS ? STRUCTURES ?
FLOW CHART ? FUNCTIONS ?
ALGORITHM ?
LOOPS ?
ARRAYS ?
SORTING ?
SEARCHING ?
STRINGS ?
PROGRAM:

 A program is a set of instructions written in an order for a particular task,


which can be executable for infinite number of times with different values at
each execution.
PROGRAMMIG LANGUAGE :

 The language which is used to develop an application is known as


programming language.

 Sum programming languages are :


FORTON PYTHON
COBOL VC++
PASCAL VIUAL BASIC
ALGOL PHP
C JAVA
C++ DOT NET
DATA TYPES :

 A data type Is the prototype of a variable.


 The data type represents the behaviour of the variable i.e; how much
memory it occupies and what type of value the variable can store.

 There are two types of data types ,they are;


primitive data types
non primitive data types
OPERATORS :

 An operator is symbol which performs operations and operands.


 An operand is a variable present in an expression based on the behaviour of
the operators.

 There are three types :


unary operators
binary operators
ternary operators
Type conversions :

Converting data type of a variable into another data type is known as type
conversion
FLOWCHART :

 Flowchart is the diagrammatic representation of flow of execution.

Start/stop

Input/output

extension A
Statement

conditon
ALGORITHM:

 A step by step manual process is known as algorithm.

EXAMPLE : program to accept 2 integers and find their sum ?


 step 1 : start.
step 2 : take 3 variables a,b,c as integers .
step 4 : add ‘a’ with ‘b’ and store result in ‘c’.
step 5 : print ‘c’.
step 6 : stop.
LOOPS :

 A loop is an iderative control structure i.e; a statement (or) a set of


statements are executed repeatedly for finite or infinite number of times
based on given condition.

 The loops are categorize into two types based on their behaviour. They are :
entry controlled loops
exit controlled loops
ARRAYS :
 An array is a collection of similar data types which shares a commo name and
occupies consecutive memory locations.

 Types of arrays :
single (or) one dimensional array
double (or) two dimensional array
multi dimensional array
SORTING :

 Sorting is the process of arranging the elements in an order (either ascending


or descending ).
 There are different types of sorting techniques :

selection sort bucket sort


bubble sort binary sort
insertion sort heap sort
quick sort shell sort
merge sort radix index sort
SEARCHING :

 Searching is a process of finding an element in the given array.

 There are 2 types. They are :


linear array (or) sequential search
binary search
STRINGS :

 A string is a collection of characters. A string in C termials (ends) with \0


(back slash zero ). We can perform different operations on string by using
string functions which are present in <string.h> header file.

String functions :
1.) str len (char s[] ); 6.) str epy ( char s2[],char s1[] );
2.) str upr ( char s[] ); 7.) str cmp ( char s1[],char s2[] );
3.) str lwr (char s[] ); 8.) str cmpi (char s1[], char s2[] );
4.) str rev ( char s[] );
5.) str cat ( cha s1[], char s2[] );
STRUCTURES :

 A structure is a collection of different data types.


 A structure starts with the keyword “struct”
 A structure end with a “ ; ” (semi colon)
Example:
Struct employ
{
int e no;
char e name [20];
float sal;
}; here ‘e’ is structure variable
Struct employ e;
FUNCTIONS :

 A function is a self contained code which can be called any number of times
at any part of the program.
 Characteristics of a function :
a function must have a written type may be of primitive (or) non primitive (or)
void.
function may or may not written a value.
function can have parameters. A function can be called any number of times.

Potrebbero piacerti anche