Professional Documents
Culture Documents
C Progrmming
C Progrmming
C programming
Data Control
Header Files Variable Operator
Type statement
6.Increment &
5.Assignment 7.Bitwise 8.Size of
Decrement
• 0
EXAMPLE OF C PROGRAM
Header file
#include<stdio.h>
(A header file is a source file that has the .h
#include<conio.h> extension)
clrscr(); clrscr()
(This function is used to clear the previous output from
printf(“Hello C”); the console)
getch();
} printf()
(This function is used for output in C language)
getch()
(This function requests for a single character. Until you
press any key it blocks the screen)
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];
STRING
• String in C programming is a sequence of characters terminated with a null
character ‘\0’.
• Strings are defined as an array of characters.
• Syntax:-
datatype string_name[ ] = {value1,value2,…}
POINTER
• A Pointer is a variable that stores the memory address of another variabe as
its value.
• Pointers in C are used to store the address of variables or a memory
location.
• Syntax:-
datatype *pointername
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.
• Syntax:-
struct structurename {
dataType member1;
dataType member2;
…
}
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.
• Syntax:-
union unionname {
dataType member1;
dataType member2;
…
}
REFERENCE
• Google
• Wikipedia
• Tutorialspoint.com
• Programiz.com
• Javatpoint.com
Thank you to all..