Overview of c language

15,321 views

Published on

Published in: Education
0 Comments
9 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
15,321
On SlideShare
0
From Embeds
0
Number of Embeds
17
Actions
Shares
0
Downloads
1,122
Comments
0
Likes
9
Embeds 0
No embeds

No notes for slide

Overview of c language

  1. 1. SHALINI KUMARI 11ERWCSO74
  2. 2. CONTENTS• INTRODUCTION• CHARACTERSTICS• STRUCTURE OF PROGRAM• DATA TYPE• IF ELSE• SWITCH CASE• LOOPING• ARRAY• POINTER• STRUCTURE• FUNCTION
  3. 3. 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.
  4. 4. CHARECTERISTICS• There are 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 are a large number of arithmetical and logical operators, such as +, +=, ++, &, ~, etc.
  5. 5. STRUCTURE OF PROGRAM• Documentation Section //optional• Link section //optional• Defining section //optional• Global declaration section //optional• Main function section //Must{ Declaration part Executable part.}
  6. 6. • Sub program section //optional• Function 1• Function 2• Function n
  7. 7. 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 TypePrimitive derived user define
  8. 8. TYPES OF DATA TYPEIn 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.
  9. 9. IF ELSE STATEMENTThe 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
  10. 10. SWITCH CASEIt is a control statement that provides a facility for multiway branching from a particular point. syntax: switch(expression) { case labels: break; }
  11. 11. LOOPINGTo execute a set of instructions repeatedly until a particular condition is being satisfied. LOOP For While Do while loop loop loop
  12. 12. 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} }
  13. 13. ARRAYAn 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
  14. 14. POINTERC allow us to store the address of one variable in another variable.Syntax: data type *ptrname; STRUCTUREBinding of different type of data member in a single entity.Syntax: struct structurename { different datatype };
  15. 15. FUNCTIONA function definition specifies the name of the function, the types and number of parameters it expects to receive, and its return type. Types of functionsBuilt in function User define function

×