SlideShare a Scribd company logo
 C is a High level structured oriented programming
language.
 Used in general purpose programming
 C was developed by DENNIS RITCHIE at AT& T Bell
Laboratories in USA between 1969-1973.
 C is a general-purpose programming language.
 C is a programming language which born at “AT & T’s Bell
Laboratory” of USA in 1972.
 C was written by Dennis Ritchie, that’s why he is also called
as father of c programming language.
 C language was created for a specific purpose i.e., designing
the UNIX operating system (which is currently base of
many UNIX based OS From the beginning, C was intended
to be useful to allow busy programmers to get things
done because C is such a powerful, dominant and supple
language
 Its use quickly spread beyond Bell Labs in the late 70’s
because of its long list of strong features.
 Simple
 Portability
 Powerful
 Platform dependent
 Structure oriented
 Case sensitive
 Compiler based
 Modularity
 Middle level language
 Syntax based language
 Use of Pointers
In C, we have 32 keywords, which have their predefined
meaning and cannot be used as a variable name. These
words are also known as “reserved words”.
Header files contain definitions of functions and
variables which can be incorporated into any C program
by using the pre-processor #include statement. Standard
header files are provided with each compiler, and cover a
range of areas, string handling, mathematical, data
conversion, printing and reading of variables.
<assert.h> Diagnostics Functions
<ctype.h> Character Handling Functions
<locale.h> Localization Functions
<math.h> Mathematics Functions
<setjmp.h> Nonlocal Jump Functions
<signal.h> Signal Handling Functions
<stdarg.h> Variable Argument List Functions
<stdio.h> Input/Output Functions
<stdlib.h> General Utility Functions
<string.h> String Functions
A data type in a programming language is a set
of data with values having predefined characteristics.
The language usually specifies the range of values for a
given data type, how the values are processed by the
computer, and how they are stored.
Variables are used to store information to be referenced
and manipulated in a computer program. They also
provide a way of labeling data with a descriptive name,
so our programs can be understood more clearly by the
reader and ourselves. It is helpful to think of variables as
containers that hold information. Their sole purpose is
to label and store data in memory. This data can then be
used throughout your program
 Characters Allowed :
 Underscore(_)
 Capital Letters ( A – Z )
 Small Letters ( a – z )
 Digits ( 0 – 9 )
 Blanks & Commas are not allowed
 No Special Symbols other than underscore(_) are
allowed
 First Character should be alphabet or Underscore
 Variable name Should not be Reserved Word
A storage class defines the scope (visibility) and life-time
of variables and/or functions within a C Program. They
precede the type that they modify. We have four
different storage classes in a C program −
 auto
 register
 static
 extern
 C Constants are also like normal variables. But, only
difference is, their values can not be modified by the
program once they are defined.
 Constants refer to fixed values. They are also called as
literals
 Constants may be belonging to any of the data type.
Syntax:
const data_type variable_name; (or) const data_type
*variable_name;
An operator is a symbol which operates on a value or a
variable. For example: + is an operator to perform addition.
There are some different type of operators:
A control statement is a statement that determines
whether other statements will be executed.
Conditional statements are used to execute a statement
or a group of statement based on certain conditions .
Following are the conditional statements:
 if
 if else
 else if
 switch
 goto
if(condition)
{
Valid C Statements;
}
Syntax for if statement in C :
If the condition is true the statements inside the
parenthesis { }, will be executed, else the control will
be transferred to the next statement after if.
if(condition)
{
Valid C Statements;
}
else
{
Valid C Statements;
}
Syntax for if :
In if else if the condition is true the statements
between if and else is executed. If it is false
the statement after else is executed.
switch(variable)
{
case 1:
Valid C Statements;
break;
-
-
case n:
Valid C Statements;
break;
default:
Valid C Statements;
break;
}
Syntax :
Switch statements can
also be called matching
case statements. If
matches the value in
variable
(switch(variable)) with
any of the case inside,
the statements under
the case that matches
will be executed. If
none of the case is
matched the statement
under default will be
executed.
Basic syntax to use ‘for’ loop is:
for (variable initialization; condition to control loop;
iteration of variable) { statement 1; statement 2; .. .. }
It is another loop like ‘for’ loop in C. But do-while loop
allows execution of statements inside block of loop for
one time for sure even if condition in loop fails.
Basic syntax to use ‘do-while’ loop is:
variable initialization; do { statement 1; statement 2; .. ..
iteration of variable; } while (condition to control loop)
It is another loop like ‘do-while’ loop in C. The ‘while’
loop allows execution of statements inside block of loop
only if condition in loop succeeds.
Basic syntax to use ‘while’ loop is:
variable initialization; while (condition to control loop) {
statement 1; statement 2; .. .. iteration of variable; }
A function is a group of statements that together
perform a task. Every C program has at least one
function, which is main(), and all the most trivial
programs can define additional functions.
A function declaration tells the compiler about a
function's name, return type, and parameters. A
function definition provides the actual body of the
function.
 The general form of a function definition in C
programming language is as follows −
Syntax:
return_type function_name( parameter list ) { body of
the function }
 A function declaration tells the compiler about a
function name and how to call the function. The
actual body of the function can be defined separately.
Syntax:
int max(int num1, int num2);
 An array is a collection of data items, all of the same
type, accessed using a common name.
 A one-dimensional array is like a list; A two
dimensional array is like a table; The C language
places no limits on the number of dimensions in an
array, though specific implementations may.
 Some texts refer to one-dimensional arrays as vectors,
two-dimensional arrays as matrices, and use the
general term arrays when the number of dimensions
is unspecified or unimportant.
 . Array variables are declared identically to variables of their data type,
except that the variable name is followed by one pair of square [ ]
brackets for each dimension of the array.
 Uninitialized arrays must have the dimensions of their rows, columns,
etc. listed within the square brackets.
 Dimensions used when declaring arrays in C must be positive integral
constants or constant expressions.
 In C99, dimensions must still be positive integers, but variables can be
used, so long as the variable has a positive value at the time the array is
declared. ( Space is allocated only once, at the time the array is declared.
The array does NOT change sizes later if the variable used to declare it
changes. )
Examples:
 int i, j, intArray[ 10 ], number; float floatArray[ 1000 ]; int tableArray[ 3
][ 5 ];
 A pointer is a variable whose value is the address of
another variable, i.e., direct address of the memory
location. Like any variable or constant, you must declare a
pointer before using it to store any variable address. The
general form of a pointer variable declaration is −
 Syntax:
type *var-name;
Here, type is the pointer's base type; it must be a valid C
data type and var-name is the name of the pointer variable.
The asterisk * used to declare a pointer is the same asterisk
used for multiplication.
Strings are actually one-dimensional array of characters
terminated by a null character '0'. Thus a null-
terminated string contains the characters that comprise
the string followed by a null.
Syntax:
char greeting[6] = {'H', 'e', 'l', 'l', 'o', '0'};
If you follow the rule of array initialization then you can
write the above statement as follows −
Strings are actually one-dimensional array of characters
terminated by a null character '0'. Thus a null-
terminated string contains the characters that comprise
the string followed by a null.
There are numerous functions defined
in "string.h" header file. Few commonly used string
handling functions are discussed below:
Function Work of Function
strlen() Calculates the length of string
strcpy() Copies a string to another string
strcat() Concatenates(joins) two strings
strcmp() Compares two string
strlwr() Converts string to lowercase
strupr() Converts string to uppercase
Arrays allow to define type of variables that can hold
several data items of the same kind.
Similarly structure is another user defined data type
available in C that allows to combine data items of
different kinds .Structures are used to represent a record
To define a structure, you must use
the struct statement. The struct statement defines a
new data type, with more than one member. The format
of the struct statement is as follows −
Syntax:
struct [structure tag] { member definition; member
definition; ... member definition; } [one or more
structure variables];
You can define pointers to structures in the same way as you
define pointer to any other variable −
Syntax:
struct Books *struct_pointer;
Now, you can store the address of a structure variable in the
above defined pointer variable. To find the address of a
structure variable, place the '&'; operator before the
structure's name as follows −
Syntax:
struct_pointer = &Book1;
A union is a special data type available in C that allows
to store different data types in the same memory
location. You can define a union with many members,
but only one member can contain a value at any given
time. Unions provide an efficient way of using the same
memory location for multiple-purpose.
To define a union, you must use the union statement in
the same way as you did while defining a structure. The
union statement defines a new data type with more than
one member for your program. The format of the union
statement is as follows −
Syntax:
union [union tag] { member definition; member
definition; ... member definition; } [one or more union
variables];
File Handling concept in C language is used for store a
data permanently in computer. Using this concept we
can store our data in Secondary memory (Hard disk). All
files related function are available in stdio.h header file.
For achieving file handling in C we need follow following
steps:
 Naming a file
 Opening a file
 Reading data from file
 Writing data into file
 Closing a file
S.No Function Operation
1 fopen() To create a file
2 fclose() To close an existing file
3 getc() Read a character from a file
4 putc() Write a character in file
5 fprintf() To write set of data in file
6 fscanf() To read set of data from file.
5 getw() To read an integer from a file
6 putw() To write an integer in file
Data structure of file is defined as FILE in the standard
I/O function. So all files should be declared as type
FILE.
Before opening any file we need to specify for which
purpose we open file, for example file open for write or
read purpose.
Syntax:
FILE *fp; pf=fopen("filename", "mode");
S.No Mode Meaning Purpose
1 r Reading Open the file for reading only.
2 w Writing Open the file for writing only.
3 a Appending Open the file for appending (or
adding) data to it.
4 r+ Reading + Writing New data is written at the
beginning override existing
data.
5 w+ Writing + Reading Override existing data.
6 a+ Reading + Appending To new data is appended at the
end of file.
S.No Function Operation Syntax
1 getc() Read a character
from a file
getc( fp)
2 putc() Write a character in
file
putc(c, fp)
3 fprintf() To write set of data
in file
fprintf(fp, "control
string", list)
4 fscanf() To read set of data
from file.
fscanf(fp, "control
string", list)
5 getw() To read an integer
from a file.
getw(fp)
6 putw() To write an integer
in file.
putw(integer, fp)
15 SCO , Dayal Bagh , Ambala Cantt
Near Panchmukhi Hanuman Mandir
Ph: 4000670, 9729666670
E-Mail Id: info.jatinbatra@gmail.com
www.batravcomputer centre.com
C presentation! BATRA  COMPUTER  CENTRE
C presentation! BATRA  COMPUTER  CENTRE

More Related Content

What's hot

C language 3
C language 3C language 3
C language 3
Arafat Bin Reza
 
C material
C materialC material
C material
tarique472
 
Declaration of variables
Declaration of variablesDeclaration of variables
Declaration of variables
Maria Stella Solon
 
Cpu-fundamental of C
Cpu-fundamental of CCpu-fundamental of C
Cpu-fundamental of C
Suchit Patel
 
USER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdf
USER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdfUSER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdf
USER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdf
SowmyaJyothi3
 
Data Types and Variables In C Programming
Data Types and Variables In C ProgrammingData Types and Variables In C Programming
Data Types and Variables In C Programming
Kamal Acharya
 
Embedded C The IoT Academy
Embedded C The IoT AcademyEmbedded C The IoT Academy
Embedded C The IoT Academy
The IOT Academy
 
pointer, structure ,union and intro to file handling
pointer, structure ,union and intro to file handlingpointer, structure ,union and intro to file handling
pointer, structure ,union and intro to file handling
Rai University
 
Concept of c data types
Concept of c data typesConcept of c data types
Concept of c data typesManisha Keim
 
structure and union
structure and unionstructure and union
structure and unionstudent
 
POINTERS IN C MRS.SOWMYA JYOTHI.pdf
POINTERS IN C MRS.SOWMYA JYOTHI.pdfPOINTERS IN C MRS.SOWMYA JYOTHI.pdf
POINTERS IN C MRS.SOWMYA JYOTHI.pdf
SowmyaJyothi3
 
Data type in c
Data type in cData type in c
Data type in c
thirumalaikumar3
 
Chapter1 c programming data types, variables and constants
Chapter1 c programming   data types, variables and constantsChapter1 c programming   data types, variables and constants
Chapter1 c programming data types, variables and constantsvinay arora
 
Strings in c mrs.sowmya jyothi
Strings in c mrs.sowmya jyothiStrings in c mrs.sowmya jyothi
Strings in c mrs.sowmya jyothi
Sowmya Jyothi
 
C programming session 04
C programming session 04C programming session 04
C programming session 04Dushmanta Nath
 
Escape Sequences and Variables
Escape Sequences and VariablesEscape Sequences and Variables
Escape Sequences and Variables
yarkhosh
 
12 computer science_notes_ch01_overview_of_cpp
12 computer science_notes_ch01_overview_of_cpp12 computer science_notes_ch01_overview_of_cpp
12 computer science_notes_ch01_overview_of_cpp
sharvivek
 
CPU : Structures And Unions
CPU : Structures And UnionsCPU : Structures And Unions
CPU : Structures And Unions
Dhrumil Patel
 
C language ppt
C language pptC language ppt
C language ppt
Ğäùråv Júñêjå
 

What's hot (20)

C language 3
C language 3C language 3
C language 3
 
C material
C materialC material
C material
 
Declaration of variables
Declaration of variablesDeclaration of variables
Declaration of variables
 
Cpu-fundamental of C
Cpu-fundamental of CCpu-fundamental of C
Cpu-fundamental of C
 
USER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdf
USER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdfUSER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdf
USER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdf
 
Data Types and Variables In C Programming
Data Types and Variables In C ProgrammingData Types and Variables In C Programming
Data Types and Variables In C Programming
 
Embedded C The IoT Academy
Embedded C The IoT AcademyEmbedded C The IoT Academy
Embedded C The IoT Academy
 
pointer, structure ,union and intro to file handling
pointer, structure ,union and intro to file handlingpointer, structure ,union and intro to file handling
pointer, structure ,union and intro to file handling
 
Concept of c data types
Concept of c data typesConcept of c data types
Concept of c data types
 
structure and union
structure and unionstructure and union
structure and union
 
POINTERS IN C MRS.SOWMYA JYOTHI.pdf
POINTERS IN C MRS.SOWMYA JYOTHI.pdfPOINTERS IN C MRS.SOWMYA JYOTHI.pdf
POINTERS IN C MRS.SOWMYA JYOTHI.pdf
 
Data type in c
Data type in cData type in c
Data type in c
 
Chapter1 c programming data types, variables and constants
Chapter1 c programming   data types, variables and constantsChapter1 c programming   data types, variables and constants
Chapter1 c programming data types, variables and constants
 
Strings in c mrs.sowmya jyothi
Strings in c mrs.sowmya jyothiStrings in c mrs.sowmya jyothi
Strings in c mrs.sowmya jyothi
 
C programming session 04
C programming session 04C programming session 04
C programming session 04
 
Escape Sequences and Variables
Escape Sequences and VariablesEscape Sequences and Variables
Escape Sequences and Variables
 
12 computer science_notes_ch01_overview_of_cpp
12 computer science_notes_ch01_overview_of_cpp12 computer science_notes_ch01_overview_of_cpp
12 computer science_notes_ch01_overview_of_cpp
 
CPU : Structures And Unions
CPU : Structures And UnionsCPU : Structures And Unions
CPU : Structures And Unions
 
C language ppt
C language pptC language ppt
C language ppt
 
Csharp4 basics
Csharp4 basicsCsharp4 basics
Csharp4 basics
 

Viewers also liked

Ch c notes
Ch c notesCh c notes
Ch c notes
Michelle Ervin
 
Questions datastructures-in-c-languege
Questions datastructures-in-c-languegeQuestions datastructures-in-c-languege
Questions datastructures-in-c-languegebhargav0077
 
important C questions and_answers praveensomesh
important C questions and_answers praveensomeshimportant C questions and_answers praveensomesh
important C questions and_answers praveensomesh
praveensomesh
 
C Unit 1 notes PREPARED BY MVB REDDY
C Unit 1 notes PREPARED BY MVB REDDYC Unit 1 notes PREPARED BY MVB REDDY
C Unit 1 notes PREPARED BY MVB REDDYRajeshkumar Reddy
 
'C' language notes (a.p)
'C' language notes (a.p)'C' language notes (a.p)
'C' language notes (a.p)
Ashishchinu
 

Viewers also liked (8)

Ch c notes
Ch c notesCh c notes
Ch c notes
 
Questions datastructures-in-c-languege
Questions datastructures-in-c-languegeQuestions datastructures-in-c-languege
Questions datastructures-in-c-languege
 
important C questions and_answers praveensomesh
important C questions and_answers praveensomeshimportant C questions and_answers praveensomesh
important C questions and_answers praveensomesh
 
C Unit 1 notes PREPARED BY MVB REDDY
C Unit 1 notes PREPARED BY MVB REDDYC Unit 1 notes PREPARED BY MVB REDDY
C Unit 1 notes PREPARED BY MVB REDDY
 
C AND DATASTRUCTURES PREPARED BY M V B REDDY
C AND DATASTRUCTURES PREPARED BY M V B REDDYC AND DATASTRUCTURES PREPARED BY M V B REDDY
C AND DATASTRUCTURES PREPARED BY M V B REDDY
 
C LANGUAGE NOTES
C LANGUAGE NOTESC LANGUAGE NOTES
C LANGUAGE NOTES
 
C notes
C notesC notes
C notes
 
'C' language notes (a.p)
'C' language notes (a.p)'C' language notes (a.p)
'C' language notes (a.p)
 

Similar to C presentation! BATRA COMPUTER CENTRE

C programming Training in Ambala ! Batra Computer Centre
C programming Training in Ambala ! Batra Computer CentreC programming Training in Ambala ! Batra Computer Centre
C programming Training in Ambala ! Batra Computer Centre
jatin batra
 
C Language Interview Questions: Data Types, Pointers, Data Structures, Memory...
C Language Interview Questions: Data Types, Pointers, Data Structures, Memory...C Language Interview Questions: Data Types, Pointers, Data Structures, Memory...
C Language Interview Questions: Data Types, Pointers, Data Structures, Memory...
Rowank2
 
Interview Questions For C Language
Interview Questions For C Language Interview Questions For C Language
Interview Questions For C Language
Rowank2
 
qb unit2 solve eem201.pdf
qb unit2 solve eem201.pdfqb unit2 solve eem201.pdf
qb unit2 solve eem201.pdf
Yashsharma304389
 
Interview Questions For C Language .pptx
Interview Questions For C Language .pptxInterview Questions For C Language .pptx
Interview Questions For C Language .pptx
Rowank2
 
Aniket tore
Aniket toreAniket tore
Aniket tore
anikettore1
 
unit 1 cpds.pptx
unit 1 cpds.pptxunit 1 cpds.pptx
unit 1 cpds.pptx
madhurij54
 
C Language (All Concept)
C Language (All Concept)C Language (All Concept)
C Language (All Concept)
sachindane
 
Opps concept
Opps conceptOpps concept
Opps concept
divyalakshmi77
 
C Language
C LanguageC Language
C Language
Aakash Singh
 
history of c.ppt
history of c.ppthistory of c.ppt
history of c.ppt
arpanabharani
 
C
CC
Esoft Metro Campus - Certificate in c / c++ programming
Esoft Metro Campus - Certificate in c / c++ programmingEsoft Metro Campus - Certificate in c / c++ programming
Esoft Metro Campus - Certificate in c / c++ programming
Rasan Samarasinghe
 
C language presentation
C language presentationC language presentation
C language presentationbainspreet
 
unit2.pptx
unit2.pptxunit2.pptx
unit2.pptx
sscprep9
 
Problem Solving Techniques
Problem Solving TechniquesProblem Solving Techniques
Problem Solving Techniquesvalarpink
 
CProgrammingTutorial
CProgrammingTutorialCProgrammingTutorial
CProgrammingTutorial
Muthuselvam RS
 
unit 1 (1).pptx
unit 1 (1).pptxunit 1 (1).pptx
unit 1 (1).pptx
PriyadarshiniS28
 

Similar to C presentation! BATRA COMPUTER CENTRE (20)

C programming Training in Ambala ! Batra Computer Centre
C programming Training in Ambala ! Batra Computer CentreC programming Training in Ambala ! Batra Computer Centre
C programming Training in Ambala ! Batra Computer Centre
 
C Language Interview Questions: Data Types, Pointers, Data Structures, Memory...
C Language Interview Questions: Data Types, Pointers, Data Structures, Memory...C Language Interview Questions: Data Types, Pointers, Data Structures, Memory...
C Language Interview Questions: Data Types, Pointers, Data Structures, Memory...
 
Interview Questions For C Language
Interview Questions For C Language Interview Questions For C Language
Interview Questions For C Language
 
qb unit2 solve eem201.pdf
qb unit2 solve eem201.pdfqb unit2 solve eem201.pdf
qb unit2 solve eem201.pdf
 
Interview Questions For C Language .pptx
Interview Questions For C Language .pptxInterview Questions For C Language .pptx
Interview Questions For C Language .pptx
 
Aniket tore
Aniket toreAniket tore
Aniket tore
 
unit 1 cpds.pptx
unit 1 cpds.pptxunit 1 cpds.pptx
unit 1 cpds.pptx
 
C Language (All Concept)
C Language (All Concept)C Language (All Concept)
C Language (All Concept)
 
Opps concept
Opps conceptOpps concept
Opps concept
 
C Language
C LanguageC Language
C Language
 
history of c.ppt
history of c.ppthistory of c.ppt
history of c.ppt
 
C
CC
C
 
Esoft Metro Campus - Certificate in c / c++ programming
Esoft Metro Campus - Certificate in c / c++ programmingEsoft Metro Campus - Certificate in c / c++ programming
Esoft Metro Campus - Certificate in c / c++ programming
 
Shanks
ShanksShanks
Shanks
 
C language presentation
C language presentationC language presentation
C language presentation
 
unit2.pptx
unit2.pptxunit2.pptx
unit2.pptx
 
Problem Solving Techniques
Problem Solving TechniquesProblem Solving Techniques
Problem Solving Techniques
 
CProgrammingTutorial
CProgrammingTutorialCProgrammingTutorial
CProgrammingTutorial
 
Introduction to C#
Introduction to C#Introduction to C#
Introduction to C#
 
unit 1 (1).pptx
unit 1 (1).pptxunit 1 (1).pptx
unit 1 (1).pptx
 

More from jatin batra

Best SMO Training &Coaching in Ambala
Best SMO Training &Coaching in AmbalaBest SMO Training &Coaching in Ambala
Best SMO Training &Coaching in Ambala
jatin batra
 
Best HTML Training &Coaching in Ambala
Best HTML Training &Coaching in AmbalaBest HTML Training &Coaching in Ambala
Best HTML Training &Coaching in Ambala
jatin batra
 
Best SEO Training & Coaching in Ambala
Best SEO Training & Coaching in AmbalaBest SEO Training & Coaching in Ambala
Best SEO Training & Coaching in Ambala
jatin batra
 
Best Photoshop Training in Ambala
 Best Photoshop Training  in Ambala Best Photoshop Training  in Ambala
Best Photoshop Training in Ambala
jatin batra
 
Best C Programming Training & Coaching in Ambala
Best C Programming Training & Coaching in AmbalaBest C Programming Training & Coaching in Ambala
Best C Programming Training & Coaching in Ambala
jatin batra
 
BASIC COMPUTER TRAINING & COACHING CENTRE IN AMBALA CANTT
BASIC COMPUTER TRAINING & COACHING CENTRE IN AMBALA CANTTBASIC COMPUTER TRAINING & COACHING CENTRE IN AMBALA CANTT
BASIC COMPUTER TRAINING & COACHING CENTRE IN AMBALA CANTT
jatin batra
 
Web Browser ! Batra Computer Centre
Web Browser ! Batra Computer CentreWeb Browser ! Batra Computer Centre
Web Browser ! Batra Computer Centre
jatin batra
 
Search Engine Training in Ambala ! Batra Computer Centre
Search Engine Training in Ambala ! Batra Computer CentreSearch Engine Training in Ambala ! Batra Computer Centre
Search Engine Training in Ambala ! Batra Computer Centre
jatin batra
 
Networking Training in Ambala ! Batra Computer Centre
Networking Training in Ambala ! Batra Computer CentreNetworking Training in Ambala ! Batra Computer Centre
Networking Training in Ambala ! Batra Computer Centre
jatin batra
 
SQL Training in Ambala ! BATRA COMPUTER CENTRE
SQL Training in Ambala ! BATRA COMPUTER CENTRESQL Training in Ambala ! BATRA COMPUTER CENTRE
SQL Training in Ambala ! BATRA COMPUTER CENTRE
jatin batra
 
Networking ! BATRA COMPUTER CENTRE
Networking ! BATRA COMPUTER CENTRENetworking ! BATRA COMPUTER CENTRE
Networking ! BATRA COMPUTER CENTRE
jatin batra
 
Ms Office 2010 Training in Ambala ! BATRA COMPUTER CENTRE
Ms Office 2010 Training in Ambala ! BATRA COMPUTER CENTREMs Office 2010 Training in Ambala ! BATRA COMPUTER CENTRE
Ms Office 2010 Training in Ambala ! BATRA COMPUTER CENTRE
jatin batra
 
Basic Computer Training Centre in Ambala ! BATRA COMPUTER CENTRE
Basic Computer Training Centre in Ambala ! BATRA COMPUTER CENTREBasic Computer Training Centre in Ambala ! BATRA COMPUTER CENTRE
Basic Computer Training Centre in Ambala ! BATRA COMPUTER CENTRE
jatin batra
 
Corel Draw Training Institute in Ambala ! BATRA COMPUTER CENTRE
Corel Draw Training Institute in Ambala ! BATRA COMPUTER CENTRECorel Draw Training Institute in Ambala ! BATRA COMPUTER CENTRE
Corel Draw Training Institute in Ambala ! BATRA COMPUTER CENTRE
jatin batra
 
Basic Computer Training Institute ! BATRA COMPUTER CENTRE
Basic Computer Training Institute ! BATRA COMPUTER CENTREBasic Computer Training Institute ! BATRA COMPUTER CENTRE
Basic Computer Training Institute ! BATRA COMPUTER CENTRE
jatin batra
 
HTML Training Institute in Ambala ! Batra Computer Centre
HTML Training Institute in Ambala ! Batra Computer CentreHTML Training Institute in Ambala ! Batra Computer Centre
HTML Training Institute in Ambala ! Batra Computer Centre
jatin batra
 
Benefits of Web Browser ! Batra Computer Centre
Benefits of Web Browser ! Batra Computer CentreBenefits of Web Browser ! Batra Computer Centre
Benefits of Web Browser ! Batra Computer Centre
jatin batra
 
SEO Training in Ambala ! Batra Computer Centre
SEO Training in Ambala ! Batra Computer CentreSEO Training in Ambala ! Batra Computer Centre
SEO Training in Ambala ! Batra Computer Centre
jatin batra
 
Internet Training Centre in Ambala ! Batra Computer Centre
Internet Training Centre in Ambala ! Batra Computer CentreInternet Training Centre in Ambala ! Batra Computer Centre
Internet Training Centre in Ambala ! Batra Computer Centre
jatin batra
 
Basic Computer Training Centre in Ambala ! Batra Computer Centre
Basic Computer Training Centre in Ambala ! Batra Computer CentreBasic Computer Training Centre in Ambala ! Batra Computer Centre
Basic Computer Training Centre in Ambala ! Batra Computer Centre
jatin batra
 

More from jatin batra (20)

Best SMO Training &Coaching in Ambala
Best SMO Training &Coaching in AmbalaBest SMO Training &Coaching in Ambala
Best SMO Training &Coaching in Ambala
 
Best HTML Training &Coaching in Ambala
Best HTML Training &Coaching in AmbalaBest HTML Training &Coaching in Ambala
Best HTML Training &Coaching in Ambala
 
Best SEO Training & Coaching in Ambala
Best SEO Training & Coaching in AmbalaBest SEO Training & Coaching in Ambala
Best SEO Training & Coaching in Ambala
 
Best Photoshop Training in Ambala
 Best Photoshop Training  in Ambala Best Photoshop Training  in Ambala
Best Photoshop Training in Ambala
 
Best C Programming Training & Coaching in Ambala
Best C Programming Training & Coaching in AmbalaBest C Programming Training & Coaching in Ambala
Best C Programming Training & Coaching in Ambala
 
BASIC COMPUTER TRAINING & COACHING CENTRE IN AMBALA CANTT
BASIC COMPUTER TRAINING & COACHING CENTRE IN AMBALA CANTTBASIC COMPUTER TRAINING & COACHING CENTRE IN AMBALA CANTT
BASIC COMPUTER TRAINING & COACHING CENTRE IN AMBALA CANTT
 
Web Browser ! Batra Computer Centre
Web Browser ! Batra Computer CentreWeb Browser ! Batra Computer Centre
Web Browser ! Batra Computer Centre
 
Search Engine Training in Ambala ! Batra Computer Centre
Search Engine Training in Ambala ! Batra Computer CentreSearch Engine Training in Ambala ! Batra Computer Centre
Search Engine Training in Ambala ! Batra Computer Centre
 
Networking Training in Ambala ! Batra Computer Centre
Networking Training in Ambala ! Batra Computer CentreNetworking Training in Ambala ! Batra Computer Centre
Networking Training in Ambala ! Batra Computer Centre
 
SQL Training in Ambala ! BATRA COMPUTER CENTRE
SQL Training in Ambala ! BATRA COMPUTER CENTRESQL Training in Ambala ! BATRA COMPUTER CENTRE
SQL Training in Ambala ! BATRA COMPUTER CENTRE
 
Networking ! BATRA COMPUTER CENTRE
Networking ! BATRA COMPUTER CENTRENetworking ! BATRA COMPUTER CENTRE
Networking ! BATRA COMPUTER CENTRE
 
Ms Office 2010 Training in Ambala ! BATRA COMPUTER CENTRE
Ms Office 2010 Training in Ambala ! BATRA COMPUTER CENTREMs Office 2010 Training in Ambala ! BATRA COMPUTER CENTRE
Ms Office 2010 Training in Ambala ! BATRA COMPUTER CENTRE
 
Basic Computer Training Centre in Ambala ! BATRA COMPUTER CENTRE
Basic Computer Training Centre in Ambala ! BATRA COMPUTER CENTREBasic Computer Training Centre in Ambala ! BATRA COMPUTER CENTRE
Basic Computer Training Centre in Ambala ! BATRA COMPUTER CENTRE
 
Corel Draw Training Institute in Ambala ! BATRA COMPUTER CENTRE
Corel Draw Training Institute in Ambala ! BATRA COMPUTER CENTRECorel Draw Training Institute in Ambala ! BATRA COMPUTER CENTRE
Corel Draw Training Institute in Ambala ! BATRA COMPUTER CENTRE
 
Basic Computer Training Institute ! BATRA COMPUTER CENTRE
Basic Computer Training Institute ! BATRA COMPUTER CENTREBasic Computer Training Institute ! BATRA COMPUTER CENTRE
Basic Computer Training Institute ! BATRA COMPUTER CENTRE
 
HTML Training Institute in Ambala ! Batra Computer Centre
HTML Training Institute in Ambala ! Batra Computer CentreHTML Training Institute in Ambala ! Batra Computer Centre
HTML Training Institute in Ambala ! Batra Computer Centre
 
Benefits of Web Browser ! Batra Computer Centre
Benefits of Web Browser ! Batra Computer CentreBenefits of Web Browser ! Batra Computer Centre
Benefits of Web Browser ! Batra Computer Centre
 
SEO Training in Ambala ! Batra Computer Centre
SEO Training in Ambala ! Batra Computer CentreSEO Training in Ambala ! Batra Computer Centre
SEO Training in Ambala ! Batra Computer Centre
 
Internet Training Centre in Ambala ! Batra Computer Centre
Internet Training Centre in Ambala ! Batra Computer CentreInternet Training Centre in Ambala ! Batra Computer Centre
Internet Training Centre in Ambala ! Batra Computer Centre
 
Basic Computer Training Centre in Ambala ! Batra Computer Centre
Basic Computer Training Centre in Ambala ! Batra Computer CentreBasic Computer Training Centre in Ambala ! Batra Computer Centre
Basic Computer Training Centre in Ambala ! Batra Computer Centre
 

Recently uploaded

Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 

Recently uploaded (20)

Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 

C presentation! BATRA COMPUTER CENTRE

  • 1.
  • 2.  C is a High level structured oriented programming language.  Used in general purpose programming  C was developed by DENNIS RITCHIE at AT& T Bell Laboratories in USA between 1969-1973.
  • 3.  C is a general-purpose programming language.  C is a programming language which born at “AT & T’s Bell Laboratory” of USA in 1972.  C was written by Dennis Ritchie, that’s why he is also called as father of c programming language.  C language was created for a specific purpose i.e., designing the UNIX operating system (which is currently base of many UNIX based OS From the beginning, C was intended to be useful to allow busy programmers to get things done because C is such a powerful, dominant and supple language  Its use quickly spread beyond Bell Labs in the late 70’s because of its long list of strong features.
  • 4.  Simple  Portability  Powerful  Platform dependent  Structure oriented  Case sensitive  Compiler based  Modularity  Middle level language  Syntax based language  Use of Pointers
  • 5.
  • 6.
  • 7.
  • 8. In C, we have 32 keywords, which have their predefined meaning and cannot be used as a variable name. These words are also known as “reserved words”.
  • 9.
  • 10. Header files contain definitions of functions and variables which can be incorporated into any C program by using the pre-processor #include statement. Standard header files are provided with each compiler, and cover a range of areas, string handling, mathematical, data conversion, printing and reading of variables.
  • 11. <assert.h> Diagnostics Functions <ctype.h> Character Handling Functions <locale.h> Localization Functions <math.h> Mathematics Functions <setjmp.h> Nonlocal Jump Functions <signal.h> Signal Handling Functions <stdarg.h> Variable Argument List Functions <stdio.h> Input/Output Functions <stdlib.h> General Utility Functions <string.h> String Functions
  • 12. A data type in a programming language is a set of data with values having predefined characteristics. The language usually specifies the range of values for a given data type, how the values are processed by the computer, and how they are stored.
  • 13. Variables are used to store information to be referenced and manipulated in a computer program. They also provide a way of labeling data with a descriptive name, so our programs can be understood more clearly by the reader and ourselves. It is helpful to think of variables as containers that hold information. Their sole purpose is to label and store data in memory. This data can then be used throughout your program
  • 14.  Characters Allowed :  Underscore(_)  Capital Letters ( A – Z )  Small Letters ( a – z )  Digits ( 0 – 9 )  Blanks & Commas are not allowed  No Special Symbols other than underscore(_) are allowed  First Character should be alphabet or Underscore  Variable name Should not be Reserved Word
  • 15.
  • 16. A storage class defines the scope (visibility) and life-time of variables and/or functions within a C Program. They precede the type that they modify. We have four different storage classes in a C program −  auto  register  static  extern
  • 17.  C Constants are also like normal variables. But, only difference is, their values can not be modified by the program once they are defined.  Constants refer to fixed values. They are also called as literals  Constants may be belonging to any of the data type. Syntax: const data_type variable_name; (or) const data_type *variable_name;
  • 18. An operator is a symbol which operates on a value or a variable. For example: + is an operator to perform addition. There are some different type of operators:
  • 19.
  • 20. A control statement is a statement that determines whether other statements will be executed.
  • 21. Conditional statements are used to execute a statement or a group of statement based on certain conditions . Following are the conditional statements:  if  if else  else if  switch  goto
  • 22. if(condition) { Valid C Statements; } Syntax for if statement in C : If the condition is true the statements inside the parenthesis { }, will be executed, else the control will be transferred to the next statement after if.
  • 23. if(condition) { Valid C Statements; } else { Valid C Statements; } Syntax for if : In if else if the condition is true the statements between if and else is executed. If it is false the statement after else is executed.
  • 24. switch(variable) { case 1: Valid C Statements; break; - - case n: Valid C Statements; break; default: Valid C Statements; break; } Syntax : Switch statements can also be called matching case statements. If matches the value in variable (switch(variable)) with any of the case inside, the statements under the case that matches will be executed. If none of the case is matched the statement under default will be executed.
  • 25. Basic syntax to use ‘for’ loop is: for (variable initialization; condition to control loop; iteration of variable) { statement 1; statement 2; .. .. }
  • 26. It is another loop like ‘for’ loop in C. But do-while loop allows execution of statements inside block of loop for one time for sure even if condition in loop fails. Basic syntax to use ‘do-while’ loop is: variable initialization; do { statement 1; statement 2; .. .. iteration of variable; } while (condition to control loop)
  • 27. It is another loop like ‘do-while’ loop in C. The ‘while’ loop allows execution of statements inside block of loop only if condition in loop succeeds. Basic syntax to use ‘while’ loop is: variable initialization; while (condition to control loop) { statement 1; statement 2; .. .. iteration of variable; }
  • 28. A function is a group of statements that together perform a task. Every C program has at least one function, which is main(), and all the most trivial programs can define additional functions. A function declaration tells the compiler about a function's name, return type, and parameters. A function definition provides the actual body of the function.
  • 29.  The general form of a function definition in C programming language is as follows − Syntax: return_type function_name( parameter list ) { body of the function }
  • 30.  A function declaration tells the compiler about a function name and how to call the function. The actual body of the function can be defined separately. Syntax: int max(int num1, int num2);
  • 31.  An array is a collection of data items, all of the same type, accessed using a common name.  A one-dimensional array is like a list; A two dimensional array is like a table; The C language places no limits on the number of dimensions in an array, though specific implementations may.  Some texts refer to one-dimensional arrays as vectors, two-dimensional arrays as matrices, and use the general term arrays when the number of dimensions is unspecified or unimportant.
  • 32.  . Array variables are declared identically to variables of their data type, except that the variable name is followed by one pair of square [ ] brackets for each dimension of the array.  Uninitialized arrays must have the dimensions of their rows, columns, etc. listed within the square brackets.  Dimensions used when declaring arrays in C must be positive integral constants or constant expressions.  In C99, dimensions must still be positive integers, but variables can be used, so long as the variable has a positive value at the time the array is declared. ( Space is allocated only once, at the time the array is declared. The array does NOT change sizes later if the variable used to declare it changes. ) Examples:  int i, j, intArray[ 10 ], number; float floatArray[ 1000 ]; int tableArray[ 3 ][ 5 ];
  • 33.  A pointer is a variable whose value is the address of another variable, i.e., direct address of the memory location. Like any variable or constant, you must declare a pointer before using it to store any variable address. The general form of a pointer variable declaration is −  Syntax: type *var-name; Here, type is the pointer's base type; it must be a valid C data type and var-name is the name of the pointer variable. The asterisk * used to declare a pointer is the same asterisk used for multiplication.
  • 34. Strings are actually one-dimensional array of characters terminated by a null character '0'. Thus a null- terminated string contains the characters that comprise the string followed by a null.
  • 35. Syntax: char greeting[6] = {'H', 'e', 'l', 'l', 'o', '0'}; If you follow the rule of array initialization then you can write the above statement as follows −
  • 36. Strings are actually one-dimensional array of characters terminated by a null character '0'. Thus a null- terminated string contains the characters that comprise the string followed by a null.
  • 37. There are numerous functions defined in "string.h" header file. Few commonly used string handling functions are discussed below: Function Work of Function strlen() Calculates the length of string strcpy() Copies a string to another string strcat() Concatenates(joins) two strings strcmp() Compares two string strlwr() Converts string to lowercase strupr() Converts string to uppercase
  • 38. Arrays allow to define type of variables that can hold several data items of the same kind. Similarly structure is another user defined data type available in C that allows to combine data items of different kinds .Structures are used to represent a record
  • 39. To define a structure, you must use the struct statement. The struct statement defines a new data type, with more than one member. The format of the struct statement is as follows − Syntax: struct [structure tag] { member definition; member definition; ... member definition; } [one or more structure variables];
  • 40. You can define pointers to structures in the same way as you define pointer to any other variable − Syntax: struct Books *struct_pointer; Now, you can store the address of a structure variable in the above defined pointer variable. To find the address of a structure variable, place the '&'; operator before the structure's name as follows − Syntax: struct_pointer = &Book1;
  • 41. A union is a special data type available in C that allows to store different data types in the same memory location. You can define a union with many members, but only one member can contain a value at any given time. Unions provide an efficient way of using the same memory location for multiple-purpose.
  • 42. To define a union, you must use the union statement in the same way as you did while defining a structure. The union statement defines a new data type with more than one member for your program. The format of the union statement is as follows − Syntax: union [union tag] { member definition; member definition; ... member definition; } [one or more union variables];
  • 43. File Handling concept in C language is used for store a data permanently in computer. Using this concept we can store our data in Secondary memory (Hard disk). All files related function are available in stdio.h header file.
  • 44. For achieving file handling in C we need follow following steps:  Naming a file  Opening a file  Reading data from file  Writing data into file  Closing a file
  • 45. S.No Function Operation 1 fopen() To create a file 2 fclose() To close an existing file 3 getc() Read a character from a file 4 putc() Write a character in file 5 fprintf() To write set of data in file 6 fscanf() To read set of data from file. 5 getw() To read an integer from a file 6 putw() To write an integer in file
  • 46. Data structure of file is defined as FILE in the standard I/O function. So all files should be declared as type FILE. Before opening any file we need to specify for which purpose we open file, for example file open for write or read purpose. Syntax: FILE *fp; pf=fopen("filename", "mode");
  • 47. S.No Mode Meaning Purpose 1 r Reading Open the file for reading only. 2 w Writing Open the file for writing only. 3 a Appending Open the file for appending (or adding) data to it. 4 r+ Reading + Writing New data is written at the beginning override existing data. 5 w+ Writing + Reading Override existing data. 6 a+ Reading + Appending To new data is appended at the end of file.
  • 48. S.No Function Operation Syntax 1 getc() Read a character from a file getc( fp) 2 putc() Write a character in file putc(c, fp) 3 fprintf() To write set of data in file fprintf(fp, "control string", list) 4 fscanf() To read set of data from file. fscanf(fp, "control string", list) 5 getw() To read an integer from a file. getw(fp) 6 putw() To write an integer in file. putw(integer, fp)
  • 49. 15 SCO , Dayal Bagh , Ambala Cantt Near Panchmukhi Hanuman Mandir Ph: 4000670, 9729666670 E-Mail Id: info.jatinbatra@gmail.com www.batravcomputer centre.com