2 C’ Language PPT

May 11, 2017 | Author: api-3728136 | Category: N/A
Share Embed Donate


Short Description

PPT2...

Description

‘C’ Language And ‘C’ Program.

Why ‘C’ ?

‘C’

• Implements basic programming languages • • • • • •

concepts. Structured programming language. Developments of other PL requires core C elements. Unix, Linux and Windows in C. Cellular phones and palmtop softwares. Gaming frameworks. Hardware devices interaction with max performance.

Alphabets, Digits, Special Symbols.

Program.

Constants, Variables, And Keywords

Instructions

C Constants. • Primary Constants.



Integer Constants. Real Constants. Character Constants. Secondary Constants. Array. Pointer. Structures and Unions. Enum.

• Integer Constants.





e.g. 426 +756 -588 etc. Character Constants. e.g. ‘E’ ‘h’ ‘=‘ ‘8’ Real Constants. +3.211e-4 e.g. 488.22 5.6e4 +85.23 -11.20

Data types declaration. int a; /* General declaration */ int a = 10; /* Valued Declaration */ float b = 12.6; float b; char c; char c = ‘y’;

Maximum values of Data Types. • int requires 2 bytes to store in memory. • • • • •

-32768 to 32767. float requires 4 bytes to store. -3.4e38 to 3.4e38. char requires 1 byte to store. A….Z and a….z also special symbols. long int requires 4 bytes to store. -2147483648 to 2147483647. double requires 8 bytes to store. -1.7e308 to 1.7e308. long double requires 10 bytes to store. -1.7e4932 to 1.7e4932.

Giving variable names (identifiers). • ‘C’ is a case-sensitive language. means ‘a’ ≠ ‘A’. • All the alphabets are allowed. • All numbers are allowed but not at the start. e.g char a9, thyy; /* Valid */ char 5abc; /* Invalid */ • Only special symbol _ (under score) is allowed. e.g. int min_max;

Keywords. auto continue enum if signed typedef volatile

break default extern long sizeof union near

case do float register static unsigned far

char double for return struct void asm

const else goto short switch while

Operators. • Numerial operators. • Logical operators. • Relational operators. • Conditional operators. • Bitwise operators.

Numerical operators. + * / % = --------------------------------------------e.g. int a, y = 10, x = 12; float b; a = y + 10; b = x / 2; a = a – b;

Relational operators. >

<

>=
View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF