SlideShare ist ein Scribd-Unternehmen logo
1 von 51
 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

Weitere ähnliche Inhalte

Was ist angesagt?

Cpu-fundamental of C
Cpu-fundamental of CCpu-fundamental of C
Cpu-fundamental of CSuchit 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.pdfSowmyaJyothi3
 
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 ProgrammingKamal Acharya
 
Embedded C The IoT Academy
Embedded C The IoT AcademyEmbedded C The IoT Academy
Embedded C The IoT AcademyThe 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 handlingRai 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.pdfSowmyaJyothi3
 
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 jyothiSowmya 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 Variablesyarkhosh
 
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_cppsharvivek
 
CPU : Structures And Unions
CPU : Structures And UnionsCPU : Structures And Unions
CPU : Structures And UnionsDhrumil Patel
 

Was ist angesagt? (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
 

Andere mochten auch

Andere mochten auch (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)
 

Ähnlich wie 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 Centrejatin 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
 
Interview Questions For C Language .pptx
Interview Questions For C Language .pptxInterview Questions For C Language .pptx
Interview Questions For C Language .pptxRowank2
 
unit 1 cpds.pptx
unit 1 cpds.pptxunit 1 cpds.pptx
unit 1 cpds.pptxmadhurij54
 
C Language (All Concept)
C Language (All Concept)C Language (All Concept)
C Language (All Concept)sachindane
 
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++ programmingRasan Samarasinghe
 
C language presentation
C language presentationC language presentation
C language presentationbainspreet
 
unit2.pptx
unit2.pptxunit2.pptx
unit2.pptxsscprep9
 
Problem Solving Techniques
Problem Solving TechniquesProblem Solving Techniques
Problem Solving Techniquesvalarpink
 

Ähnlich wie 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
 

Mehr von jatin batra

Best SMO Training &Coaching in Ambala
Best SMO Training &Coaching in AmbalaBest SMO Training &Coaching in Ambala
Best SMO Training &Coaching in Ambalajatin batra
 
Best HTML Training &Coaching in Ambala
Best HTML Training &Coaching in AmbalaBest HTML Training &Coaching in Ambala
Best HTML Training &Coaching in Ambalajatin batra
 
Best SEO Training & Coaching in Ambala
Best SEO Training & Coaching in AmbalaBest SEO Training & Coaching in Ambala
Best SEO Training & Coaching in Ambalajatin batra
 
Best Photoshop Training in Ambala
 Best Photoshop Training  in Ambala Best Photoshop Training  in Ambala
Best Photoshop Training in Ambalajatin 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 Ambalajatin 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 CANTTjatin batra
 
Web Browser ! Batra Computer Centre
Web Browser ! Batra Computer CentreWeb Browser ! Batra Computer Centre
Web Browser ! Batra Computer Centrejatin 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 Centrejatin 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 Centrejatin 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 CENTREjatin batra
 
Networking ! BATRA COMPUTER CENTRE
Networking ! BATRA COMPUTER CENTRENetworking ! BATRA COMPUTER CENTRE
Networking ! BATRA COMPUTER CENTREjatin 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 CENTREjatin 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 CENTREjatin 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 CENTREjatin 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 CENTREjatin 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 Centrejatin 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 Centrejatin 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 Centrejatin 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 Centrejatin 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 Centrejatin batra
 

Mehr von 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
 

Kürzlich hochgeladen

Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.MateoGardella
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...KokoStevan
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 

Kürzlich hochgeladen (20)

Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 

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