OVERVIEW OF C LANGUAGE Prepared By G Usha

OVERVIEW OF C LANGUAGE Prepared By: G. Usha. Rani B. Pranalini A. S. Lalitha

CONTENTS • • • INTRODUCTION CHARACTERSTICS STRUCTURE OF PROGRAM DATA TYPE IF ELSE SWITCH CASE LOOPING ARRAY POINTER STRUCTURE FUNCTION

INTRODUCTION • C language is one of the most popular computer language today because it is a structured , low level , machine dependent language • It is developed by DENNIS RITCHIE in between 1969 and 1973 at bell labs.

CHARECTERISTICS • There a small, fixed number of keywords, including a full set of flow of control primitives : for, while, if, do while and switch. • More than one assignment may be performed in a single statement. • There a large number of arithmetical and logical operators, such as +, +=, ++, &, ~, etc.

STRUCTURE OF PROGRAM • • • { Documentation Section //optional Link section //optional Defining section //optional Global declaration section //optional Main function section //Must Declaration part Executable part. }

• Sub program section //optional Function 1 • Function 2 • • Function n

WHAT IS DATA TYPE ? A data type in a programming language is a set of data values having predefine characteristics. there are three classes of data types: Data Type Primitive derived user define

TYPES OF DATA TYPE In c language compiler support five fundamental data type namely integer (int), character(char), floating point(float), double and void. Derived data types are array, structure, pointer, function. A user define data type is basically made by the user itself.

IF ELSE STATEMENT The if statement is a powerful decision making statement. If. . else statement is a extention of the simple if statement. The general form is : if(test expression) { true-block statement(s) } else { false –block statement(s) } n

SWITCH CASE It is a control statement that provides a facility for multiway branching from a particular point. syntax: switch(expression) { case labels: break; }

LOOPING To execute a set of instructions repeatedly until a particular condition is being satisfied. LOOP For loop While loop Do while loop

Syntax of loops For loop. For(intialization ; test condition ; increment) { Body of the loop } While loop. Do while loop. While(test condition) do { { Body of the loop body of the loop } }

ARRAY An array is a collection of elements of the same data type. Syntax : data type arrayname[size]; Type of array 1 dimensional 2 dimensional Multi-dimensional

POINTER C allow us to store the address of one variable in another variable. Syntax: data type *ptrname; STRUCTURE Binding of different type of data member in a single entity. structurename Syntax: different datatype { };

FUNCTION A function definition specifies the name of the function, the types and number of parameters it expects to receive, and its return type. Types of functions Built in function User define function

- Slides: 16