0% found this document useful (0 votes)
25 views

C Language: Livesoft @

C is a general purpose, powerful, efficient, and portable programming language well suited for system and application software development. It supports basic data types like integers, characters, floats, and doubles. C programs are composed of functions and typically include declarations, a main function, and other functions. C uses variables to store and manipulate data, and operators to perform operations on variables.

Uploaded by

chinva
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

C Language: Livesoft @

C is a general purpose, powerful, efficient, and portable programming language well suited for system and application software development. It supports basic data types like integers, characters, floats, and doubles. C programs are composed of functions and typically include declarations, a main function, and other functions. C uses variables to store and manipulate data, and operators to perform operations on variables.

Uploaded by

chinva
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 10

C Language

LiveSoft
C Language
Features
•C is a general purpose structured
programming language.
•C is powerful, efficient, compact &
flexible.
•C is highly portable
•C has a rich set of built-in functions
and operators that can be used to
write any complex program.
C Language
Features
•C is well suited for writing System
Software as well as Application
Software.
•C language allowes accessing of
memory locations with the help of
pointers which holds the address of
the memory location.
•C language allows dynamic allocation
of memory (at run time)
C Language
Structure of the C program
global declarations;
main()
{
local variables;
statements;
}
function1()
{
local variables;
Statements;
}
C Language
Data Types
•Data Type decides the type of data to
be accessed.
•C supports 4 classes of data types
•1) Primary (int, char, float, double)
•2) User-defined (typedef)
•3) Derived (Arrays, Pointers,
Structures, Unions, Enum)
•4) Empty (void)
C Language
Data Types
Data Type Memory Range of Values
char 1 byte 0 to 255
int 2 bytes -32,768 to 32,767
float 4 bytes 3.4e-38 to 3.4e+38
double 8 bytes 1.7e-308 to 1.7e+308
Ex: int sno, tot, sum;
char ch, op;
char sname[20];
float price;
C Language
Variables & Constants
•Variable : A variable is a data name
which can be used to store a data & a
variable may take different values at
different times, during execution of the
program.
•Constant : It is also a data name
which can be used to store a fixed
data & this data does not change
during execution of the program.
C Language
Operators
•Operators are symbols which
represent a particular operation that
can be performed on data.
•1) Arithmetic ( +, -, *, / )
•2) Increment & Decrement ( ++, -- )
•3) Modulo Division (%)
•4) Relational ( >, <, >=, <=, ==, != )
•5) Logical ( and &&, or ||, not ! )
C Language - Operators
•6) Assignment ( = )
•7) Conditional (?)
(it evaluates conditions)
[ max=(x>y)?x:y; ]
•8) Comma Operator (,)
(it permits different expressions to
appear in situations where only one
expression would ordinarily be used)
[ res=(a=5,b=6,a*b); ]
•9) Bit Wise ( ~, >>, <<, &, |, ^ )
C Language - Operators
•10) sizeof( ) operator: It returns the no.
of bytes occupied by the operand which
can be a variable, constant etc.

Ex: int x=10,y;


y=sizeof(x);

You might also like