Batra Computer Centre is An ISO certified 9001:2008 training Centre in Ambala.
We Provide C Training in Ambala. BATRA COMPUTER CENTRE provides best training in C, C++, S.E.O, Web Designing, Web Development and So many other courses are available.
3. Content
Introduction
Control Statements
Functions
Arrays & Strings
Pointers, Structures & Union
File Handling
150 Programming Practice on PC
BATRA COMPUTER CENTRE Email: info.jatinbatra@gmail.com
Ph. No. :9729666670,4000670 Website: www.batracomputercentre.com
4. What is C language
BATRA COMPUTER CENTRE Email: info.jatinbatra@gmail.com
Ph. No. :9729666670,4000670 Website: www.batracomputercentre.com
• C is a high-level and general-
purpose programming language that
is ideal for developing firmware or
portable applications.
• Originally intended for writing system
software, C was developed at Bell Labs
by Dennis Ritchie for the Unix
Operating System (OS) in the early
1970s.
5. C Programming
BATRA COMPUTER CENTRE Email: info.jatinbatra@gmail.com
Ph. No. :9729666670,4000670 Website: www.batracomputercentre.com
An example of simple program in C:
#include<stdio.h>
void main()
{
printf(“I Love Programmingn”);
printf(“You will Love it too”);
printf(“once you know the trick”);
}
6. Control Statement
A control statement is a statement that
determines whether other statements
will be executed.
• An if statement decides whether to
execute another statement, or decides
which of two statements to execute.
• A loop decides how many times to
execute another statement.
BATRA COMPUTER CENTRE Email: info.jatinbatra@gmail.com
Ph. No. :9729666670,4000670 Website: www.batracomputercentre.com
8. Functions
• 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.
• You can divide up your code into
separate functions.
BATRA COMPUTER CENTRE Email: info.jatinbatra@gmail.com
Ph. No. :9729666670,4000670 Website: www.batracomputercentre.com
12. Arrays
BATRA COMPUTER CENTRE Email: info.jatinbatra@gmail.com
Ph. No. :9729666670,4000670 Website: www.batracomputercentre.com
• 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.
13. v
BATRA COMPUTER CENTRE Email: info.jatinbatra@gmail.com
Ph. No. :9729666670,4000670 Website: www.batracomputercentre.com
14. Strings
BATRA COMPUTER CENTRE Email: info.jatinbatra@gmail.com
Ph. No. :9729666670,4000670 Website: www.batracomputercentre.com
• A string in C is merely an array of
characters. The length of a string is
determined by a terminating null
character: '0' .
• So, a string with the contents, say, "abc"
has four characters: 'a' , 'b' , 'c' , and the
terminating null character.
• The terminating null character has the
value zero.
16. Pointers
BATRA COMPUTER CENTRE Email: info.jatinbatra@gmail.com
Ph. No. :9729666670,4000670 Website: www.batracomputercentre.com
• A pointer is a variable which contains the
address in memory of another variable.
• We can have a pointer to any variable
type.
• The unary or monadic operator & gives
the ``address of a variable''.
• The indirection or dereference operator *
gives the ``contents of an object pointed
to by apointer''.
18. Structures
BATRA COMPUTER CENTRE Email: info.jatinbatra@gmail.com
Ph. No. :9729666670,4000670 Website: www.batracomputercentre.com
• 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. Suppose you want to keep track
of your books in a library.
• To define a structure, you must use
the struct statement. The struct
statement defines a new data type, with
more than one member.
20. Unions
• 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.
BATRA COMPUTER CENTRE Email: info.jatinbatra@gmail.com
Ph. No. :9729666670,4000670 Website: www.batracomputercentre.com
23. File Handling
• File Handling in C Language.
• A file represents a sequence of bytes
on the disk where a group of related
data is stored.
• File is created for permanent storage
of data. It is a ready made structure.
BATRA COMPUTER CENTRE Email: info.jatinbatra@gmail.com
Ph. No. :9729666670,4000670 Website: www.batracomputercentre.com
27. BATRA COMPUTER CENTRE Email: info.jatinbatra@gmail.com
Ph. No. :9729666670,4000670 Website: www.batracomputercentre.com
ABOUT US
We have own Centre library that has sufficient
books of great authors for our students.
Notes prepared by our teachers
are provides to every student for
their review. We also provide
particular software’s our students
on which they are pursuing their courses. Extra
classes are given to those students who need
some extra time or in case miss due to some
reason.