0% found this document useful (0 votes)
67 views6 pages

Jitesh Police

This document provides an overview of key concepts in the C programming language including: - C was developed in 1972 by Dennis Ritchie and is known for its portability and low-level access to memory. - Constants cannot change value during program execution, and include primary types like integers and characters, and secondary types like arrays and structures. - Variables store values that can change, and have data types like int and float. - C has keywords, operators, and expressions to perform tasks. Control structures like if/else and loops alter program flow. - Input/output functions allow reading from and writing to devices. Formatted functions like printf specify formats while unformatted functions like getchar

Uploaded by

Jitesh Police
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views6 pages

Jitesh Police

This document provides an overview of key concepts in the C programming language including: - C was developed in 1972 by Dennis Ritchie and is known for its portability and low-level access to memory. - Constants cannot change value during program execution, and include primary types like integers and characters, and secondary types like arrays and structures. - Variables store values that can change, and have data types like int and float. - C has keywords, operators, and expressions to perform tasks. Control structures like if/else and loops alter program flow. - Input/output functions allow reading from and writing to devices. Formatted functions like printf specify formats while unformatted functions like getchar

Uploaded by

Jitesh Police
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 6

Jitesh Kumar Sharma

Shimla, District Shimla (H.P.)

Notes of C language: -
C is a programming language
developed at AT & T’s Bell laboratories of USA,
in 1972. “Dennis Ritchie” is known as the
designer and writer of C language.

Constants: - Those data items which are fixed


and their values can not be changed during
program execution, are called constants.

Types of C Constants: - Constants can be


grouped in two main group i.e. primary
constants and secondary constants. The
category of secondary constants contains
Arrays, Pointers, Structures and Unions.

C constants

Primary Constants Secondary


constants
Integer Constants Arrays
Real Constants Pointers
Character Constants Unions

Variables: - A variable is a name given to a


memory allocation that has been used to store
any value. It is clear from the name that the
value stored in a variable can be changed at
any instance of time, during the program
execution.

Data Type: - Data type represents type of input


to be carried in the variable.

C Keywords: - every language has a set of


characters, whose meaning is already defined
and known to the compiler. C complier has 32
keywords. The list of those keywords is given
as follows: -

auto break case char continue


default do double else float
for goto if int long
signed static struct switch union
unsigned void while enum extern
register typedef
Operators: - An operator, in general, is a
symbol that operates on a certain data type.
An operator is a symbol that tells the computer
to perform certain mathematical or logical
manipulations. The data items on which
operators act upon are called operands. Some
operators require one operand while others
require two operands. The operators in C can
be classified into a No. of categories. They
include:-

• Arithmetic Operators
• Relational Operators
• Logical Operators
• Assignment Operators
• Increment and Decrement Operators
• Conditional Operators
• Bitwise Operators
• Special Operators

Expression: - An expression consists of one or


more operands linked together by zero or more
operators. Expressions in C can be classified
into the following categories, depending upon
the type of operators being used: -

 Arithmetic Expression
 relational Expression
 Logical Expression
 Conditional Expression

Unformatted Input/output functions : - The


standard input/ Output functions which accept
the data or which provide the data to complier
in any random way. Unformatted input
functions are getch(), getche(), getch() and
unformatted output functions are putchar()
function.

Formatted I/O functions: - formatted input/


output functions are those which accept input
from the standard input device (Keyboard) and
produces the output or result on to the
standard output device (monitor). Scanf()
function is formatted input function and
printf() is a formatted output function.

Control Structures: - Control structures are


those structures which are used to change the
sequential order of execution of instructions.
There are two types of control structures in C: -

i) Decision Control Structure: -Those


structures which are used for decision making
and are capable to change the control of
execution of statements based on certain
conditions are known as decision control
structures. The various decision control
structures supported by C are if statement,
switch statement, goto statement.

ii) Looping: - Those structures which are used


to execute a group of instructions repeatedly,
until some logical condition has been satisfied
are known as loops. C language supports three
types of looping statements which are while, do
while, for statement.

goto statement : - The goto statement is


used to change the normal sequence of
program execution by transferring control to
some other part of the program. In its general
form, goto statement is written as

goto label;

if goto statement is written before writing a


label statement then it is known as forward
jumping and if a goto statement is written
after writing a label statement then it is known
as backward jumping. To write structured
program in C language, use of goto statement
should be avoided.

Looping : - A group of instruction which is


executed repeatedly is called a looping
statement. A program loop consists of two
parts, one known as the body of the loop and
the other is known as control statement. The
loops in C are divided into two categories: -

 Entry Controlled Loop or Pre tested loop


 Exit Controlled Loop or Post tested loop

In entry controlled loops, the control conditions


are tested before executing the body of the
loop. In the case of exit controlled loop, the
control conditions are tested after executing
the body.

You might also like