C Program Language

C Program Language
Datatypes
Built-in Type
Integer
Signed
int
16 bits
Ex:-32,768 to32,767
short int
8 bits
Ex:-128 to127
long int
32bits
Ex:-2,147,483,648 to 2,147,483,647
Unsigned
long int
32bits
Ex:-2.147,483,648 to 2,147,483,647
short int
8bits
Ex:-128 to 127
int
16 bits
Ex:-32,768 to 32767
Float
long double
80bits
Ex: 3.4E-4932 to 1.1E+4932
float
32 bits
Character
Signed char
8bits
Ex:-128 to127
Unsigned char
8bits
Ex: 0 to255
Char
Double
double
64bits
Ex: 1.7E-308 to 1.7 E+308
Derived Type
Array
Funtions
Pointer
Reference
User Defined Types
Structure
Union
Enumeration
C- Tokens
Special Symbols (Delimeters)
;,!?#$
Constants & Variables
Keywords
Identifiers
Strings
Operators
Numeric Constants
Character Constants
int
%d
decimal
octal
hexadecimal
Ex: -129, 78 etc
Ex: 037, 5011 etc
Ex: 0X2, 0XA3 etc
float
real
exponential
%f
Ex: -2.73, 0.71 etc
12e-2
-1.2E-1
Single
String
Expressions
Arithmetic
Conversions
Arithmetic
Logical
Assignment
Conditional
Special
Increment / Decrement
Bitwise
Relational
Mathematical Functions
#include<math.h> cc filename -lm
automatic type
casting a value
follows the hierarchy of size of the operands
(type name)exp;
example
exp(x)
fabs(x)
sqrt(x)
precedence
example
Input/Output
Formatted
Unformatted
Input
Output
putchar
getchar
putchar(variable_name);
scanf("control string", &arg1,&arg2..);
printf("control string", arg1,arg2..);
Control Statements
if
swicth
conditional
goto
simple if
if else
nested if else
else if ladder
switch(exp){ case value1:block1; break; case value2:block2; break; ..........default:block; break; } statement-x;
conditional exp? exp1:true exp2:false
Loops
Arrays
Strings
continue (skip)
for
for(initialize ; test exp ; increment) { body; }
while
while(test exp) { body; }
do.. while
do { body ; } while(test exp);
break (jump)
Dimensions
Character Array (String)
Declaring / Initialising
Reading
Writing
Concatenation
Comparison
Copying
Substr and many more string functions are available...
Built in function in ctype.h
Functions
Pointers
Structures / Unions
Files
declaration
calling
types
definition
Recursion
declaring
initialize
accessing
define a structure
initialization members
Open
Close
Input
Access
Output
mode
History of C
ALGOL
BCPL
B
Traditional C
ANSI C
ANSI/ ISO C
Dennis Retchie
Few Other Links
Companies using C Programming Language
NPTEL Videos
NPTEL Slides
Virtal Lab
Spoken Tutorials
30 1 1