Pic 1 To 3 Chaptersslide Shows 1-59
Pic 1 To 3 Chaptersslide Shows 1-59
Pic 1 To 3 Chaptersslide Shows 1-59
Abhonkar
Department of Computer
Sandip Polytechnic
Chapter 1
Basics of 'C'
Program
A computer program is a set of instructions, executed step by step
ExampIe: Addition of two numbers
In this exampIe steps wiII be:
1) Take two numbers
2) Add these two numbers
3) DispIay the addition
These instructions are executed step by step
Programming Language
A program is written using a programming language
Example: C,C++,VB,Java etc.
There are two tpes o! programming languages:
"# $igh %evel %anguage: human un&erstan&a'le,
contains English li(e wor&s, user !rien&l.
)# %ow %evel %anguage: un&erstan& ' computer,
'inar language, machine language
How Computer Understands Program ?
There are two was through which a computer can
un&erstan& the program i.e. a program is execute&,
". *nterpretation:
L operator:
L means the a&&ress o!
Ex, n is a varia'le, then
&n will give the a&&ress o! varia'le n
T operator:
T means at the a&&ress
Ex, n is a varia'le having value 3 i.e n B 3
p is a varia'le storing a&&ress o! n i.e p B Ln , then
T p will give value 3 i.e. value at the a&&ress p
n
1011
3
p
1011
After p = &n
After w = *p
w
3
After n = 3
Precedence and Associativity of Operators
Ex, c B a T ' S
Qeneral .ntax:
scan!GXcontrol stringX, arg", arg), arg3...argn#S
$ere control string will 'e &ata tpe speci!ier an& arguments will
'e the varia'les where the &ata is to 'e store&.
BacksIash Character Meaning
\n New Line
\t HorizontaI Tab
\v VerticaI Tab
\b Backspace
\ DoubIe Quote
\' SingIe Quote
\\ BacksIash
A SimpIe 'C' program
CompiIation (AIt F9)
Execution (CtrI F9)
RuIes for writing 'C' program