Ravi

Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

C PROGRAMMING

C programming

Presented By: Mukul Porwal


Submitted to: Submitted by:
Vishal Namdev Sir RAVINDER
INTRODUCTION OF C
• C is developed by Dennis Ritchie in 1972.
• C is a structured programming language.
• C is a powerful programming language.
• This helps make programming easier and keeps the
code clean.

Dennis Ritchie
CONTENT OF C LANGUAGE

Data Control
Header Files Variable Operator
Type statement

Structures &
Loops Arrays Functions
Unions
HEADER FILE
• The files that are specified in the include section is called as Header File .
• Header file is given an extension .h.
• C Source file is given an extension .c.

C has different types of Header File.

stdio.h conio.h string.h ctype.h math.h


VARIABLE
• A variable is a name of the memory location. It is used to store data.
• Variable is a container in C programmer to hold values.
• Its value can be changed, and it can be reused many times.
• Types of variables.…

1.Local 2.Global 3.Static 4.Auotmatic 5.External


Variable Variable Variable Variable Variable
DATA TYPE
• A data type specifies the type of data that a variable can store such as
integer, floating, character, etc.
• Each variable in C has an associated data type.
• Data types are used while defining a variable or functions in C.
• Types of data types….

1.Basic Data 2.Derived 3.Enumeration 4.Void Data


type Data type Data type type
OPERATOR
• An operator is a symbol that operates on a value or a variable.
• An operator is a symbol that tells the complier to perform specific
mathematical or logical functions.
• In C language many of kinds of operators are present like . .

1.Arithmatic 2.Relational 3.Logical 4.Conditional

6.Increment &
5.Assignment 7.Bitwise 8.Size of
Decrement
CONTROL STATEMENT
• C program is a set of statements.
• Such statements by which we determine the flow of a program are called
Control Statement.
• C supports some statement like . . .

2.switch 3.goto
1.if statement
statement statement
LOOP
• Loops are used to execute the statements repeatedly.
• Loops in C language are used to execute a code again and again.
• In C language loops are three types.

3. do-while
loop
ARRAY
• An array is defined as the collection of similar type of data items stored at
contiguous memory locations.
• An array is a derived data type in c programming.
• Arrays are used to store multiple valuss in a single variable.
• C language has three types of Arrays . . .

1. One- 2.Two- 3. Multi-


Dimensional Dimensional Dimensional

• Syntax:-
1D Arrays: int arr[n];
2D Arrays: int arr[m][n];
FUNCTION
• A function is a self-contained block of code that performs a particular task.
• Syntax:-
return_type name_of_function (Type1 ARG1,Type2
ARG2,Type3 ARG3)
• C functions classified into two categories.

1. Library 2. User-Define
Functions Functions
STRUCTURE
• A structure is a collection of data items of different types.
• A structure contains an ordered group of data objects.
• Each variable in the structure is known as a member of the structure.
• C language supports a constructed data type know as structures.
UNIONS
• Unions are a concept borrowed from structures.
• A union is a special data type available in C that allows to store different data
types in the same memory location.
Thank you to all..

You might also like