AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
A quick introduction to c programming
1. A Quick Introduction to CA Quick Introduction to C
Programming..Programming..
MOHITMOHIT
PATODIYAPATODIYA
(BCA II(BCA IIndnd
Year)Year)
2. Introduction..Introduction..
• C Language was invented by Dennis Ritchi
in 1972.
• C Language was invented at Bell Telephone
laboratory.
• C is a basic language.
• C is a free format language.
• C is a middle Level Programming Language.
3.
4. Standard C..Standard C..
• Standardized in 1989 by ANSI (American National
Standards Institute) known as ANSI C
• International standard (ISO) in 1990 which was
adopted by ANSI and is known as C89
• As part of the normal evolution process the standard
was updated in 1995 (C95) and 1999 (C99)
• C++ extends C to include support for Object Oriented
Programming and other features that facilitate large
software development projects
• C is not strictly a subset of C++, but it is possible to
write “Clean C” that conforms to both the C++ and C
standards
5. Components of C..Components of C..
• Keywords
• Identifiers
• Data Types
• Operators
• Variables
• Separators
6. KeywordsKeywords
Keywords are
the words that
convey a special
meaning to the
language
compiler.
Keywords in C..
1. auto
2. break
3. case
4. char
5. const
6. continue
7. default
8. do
9. double
10. else
11. enum
12. extern
13. float
14. for
15. goto
16. if
17. Int
18. Long
19. Register
20. Return
21. Short
22. Signed
23. Sizeof
24. Static
25. Struct
26. Switch
27. Typedef
28. Union
29. Unsigned
30. Void
31. Volatile
32. while
9. Data types useD in C programming..Data types useD in C programming..
Data types Term Control
String
Memory
Allocation
Example
Integer Int %d 2 bytes 0-9
Character Char %c 1 bytes A-Z or a-z
Float Float %f 4 bytes After decimal 6
bytes
Double Double %lf 8 bytes After decimal 12
bits
10. OperatorsOperators
....
Operator is
performed the
specific operation
on constant
values or
operand.
Operators in C..
1. Airthmetic Operator.
2. Logical Operator.
3. Relational Operator.
4. Assignment Operator.
5. Increment/Decrement
Operator.
6. Bitwise Operator.
15. Increment /DecrementIncrement /Decrement
Operator..Operator..
Shortening even more some expressions, the increase operator
(++) and the decrease operator (--) increase or
reduce by one the value stored in a variable. They are equivalent
to +=1 and to -=1, respectively.
For example :
Example 1, B is increased before its value is copied to A. While in
Example 2, the value of B is copied to A and then B is increased.
17. Variable is the named memory
location which holds a data
value of a particular data type.
Variables..
18. The declaration of a variable generally
takes the following form :-
datatype variable 1,variable 2, … … .,variable n;
for example:
int num1,num2;
Declaration of Variable..
19. Seprators are the symbols use in C
programming. Such as :-
{
}
[
]
(
)
;
,
.
Separators..
c
c
c
20. GettingStartedWithC…GettingStartedWithC…
#include inserts another file. “.h” files are called
“header” files. They contain stuff needed to interface
to libraries and code in other “.c” files.
This is a comment. The compiler ignores this.
The main() function is always where your
program starts running.
Blocks of code (“lexical scopes”) are
marked by { … }
Print out a message. ‘n’ means “new line”.
Notas del editor
This presentation demonstrates the new capabilities of PowerPoint and it is best viewed in Slide Show. These slides are designed to give you great ideas for the presentations you’ll create in PowerPoint 2010!
For more sample templates, click the File tab, and then on the New tab, click Sample Templates.