0% found this document useful (0 votes)
20 views4 pages

Features of C Language

The document outlines the features of the C programming language, highlighting its simplicity, portability, and rich library. It details various data types, including basic, derived, enumeration, and void types, as well as operators such as arithmetic, relational, logical, and bitwise operators. Additionally, it explains memory management, pointers, and the extensibility of C, making it a versatile mid-level programming language.

Uploaded by

yalla.jagadeesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views4 pages

Features of C Language

The document outlines the features of the C programming language, highlighting its simplicity, portability, and rich library. It details various data types, including basic, derived, enumeration, and void types, as well as operators such as arithmetic, relational, logical, and bitwise operators. Additionally, it explains memory management, pointers, and the extensibility of C, making it a versatile mid-level programming language.

Uploaded by

yalla.jagadeesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

FEATURES OF C LANGUAGE:

C is the widely used language. It provides a lot of features that are given below.
1. Simple 2. Machine Independent or Portable 3. Mid-level programming
language
4. structured programming language 5. Rich Library 6. Memory Management
7. Fast Speed 8. Pointers 9. Recursion 10. Extensible
1. Simple:
C is a simple language in the sense that it provides structured approach (to break the
problem into parts)
2. Machine Independent or Portable:
C Programs can be executed in many machines with little bit or no change.
3. Mid-level Prorgramming language:
C is also used to do low level programming. It also supports the feature of high
level language. That is why it is known as mid-level language.
4. Structured prorgramming language:
C is a structured programming language in the sense that we can break the program
into parts using functions.
5. Rich Library:
C provides a lot of inbuilt functions that makes the development fast.
6. Memory Management:
It supports the feature of Dynamic Memory Allocation.
7. Speed:
The compilation and execution time of C language is fast.
8. Pointers:
C provides the feature of pointers. We can directly interact with the memory by using the
pointers. We can use pointers for memory, structures, functions, array etc.
9. Recursion:
In c, we can call the function within the function.
10. Extensible:
C language is extensible because it can easily adopt new features.

DATA TYPES IN C:
A data type specifies the type of data that a variable can store such as integer, floating,
character etc.

There are 4 types of data types in C language.


Types Data Types
Basic Data Type int, char, float, double
Derived Data Type array, pointer, structure, union
Enumeration Data Type enum
Void Data Type void

1. Basic Data Types :


The basic data types are integer-based and floating-point based. C language supports both
signed and unsigned literals. The memory size of basic data types may change according to 32
or 64 bit operating system. the following are basic data types. Its size is given according to 32
bit architecture.
They are 4 types of data types are there (1) integer (2)character (3 )flaot(4)double
(1)Integer datatype:
 Integer datattype allow a variable a store numerical value.
 Int keyword are used in integer datatype.
 Int(2 byte) can store value from -32768 to +32767
 Int(4 byte) can store value from -2,147,483,648 to + 2,147,483,647.
 Here, “%d” is a format specification for integer variables.
(2) character datattype:
 character datatype allow a variable to store only one character.
 Size of character datatype is 1.we can store only one character using character
datatype.
 “char” keyword is used to refer character datatype.
 For example,’a’ can be stored using char datatype. you data can’t store more then one
charcter using character datatype .
 Charcter datatype store value singed charcter are -127 to +128 and unsigned
characters are 0 to 255.
Here, “%ch” is a format specification for character datatype.
(3)float datatype:
 float datatype allows a variable to store decimal values.
 Storage of float datatype is 4.
 We can use upto 6 digits after decimal using as int datatype.
 Eg.10.546789 can stored in variable using float datatype.
 The range of float 1.2e-3.8 to3.4e-3.8.
 Here,”%f” is a format specification for float datatype.
(4)double datatype:
 Double datatype is also same as flaot datatype which allows upto 10 digits after
decimal.
 The range of 8bytes 1e-3.7 to1e-3.7
 Here, “%lf” is a format specification for double datatype.
Enumerated datatype:
 Enumeration datatype consists named integers constant as a list.
 It starts with 0 by default and value is incremented by 1 for the sequential identifiers list.
 Enumerated sytax in c
Enum identifier[ optional{enumerated list}];
 Here you want use “#define” is preprocessor directive.
Void datatype:
 Void is an empty datatype that has no value.
 This can be used in functions and pointers.
C OPERATORS:
An operator is simply a symbol that is used to perform operations. There can be many
types of operations like Arithmetic, Relational, Logical and Bitwise Operators etc. The following
types of operators are performs different types of operations in C language.
1. Arithmetic Operators 2. Relational Operators 3. Logical Operators
4. Bitwise Operators 5. Ternary or Conditional Operators 6. Assignment Operator
7. Shift Operators

1. Arithmetic Operators:
Arithmetic operators performs basic arithmetic operations like Addition, Subtraction,
Multiplication, Division and Modulus division etc., Assume variable a holds 10 and variable b holds
20, then:
S.No. Operato
Description Example
r
1. + Addition - Adds values on either side of the operator a + b will give 30
Subtraction - Subtracts right hand operand from left
2. - a - b will give -10
hand operand
Multiplication - Multiplies values on either side of the
3. * a * b will give 200
operator
Division - Divides left hand operand by right hand
4. / b / a will give 2
operand
Modulus - Divides left hand operand by right hand
5. % b % a will give 0
operand and returns remainder
6. ++ (Increment)- Increases an integer value by one A++ will gives 11
7 -- (Decrement) - Decreases an integer value by one A-- will gives 9

2. Relational or Comparison Operators:


These Operators are used to compare two or more Operands or Variables and then produce
either True or False. These Operators are used to build Relational Or Boolean Expressions. Assume
variable a holds 10 and variable b holds 20, then:
S.No Operato Description Example
. r
Checks if the values of two operands are equal or not, (a == b) is not
1. ==
if yes then condition becomes true. true.
Checks if the values of two operands are equal or not,
2. != (a != b) is true.
if values are not equal then condition becomes true.
Checks if the value of left operand is greater than the
(a > b) is not
3. > value of right operand, if yes then condition becomes
true.
true.
Checks if the value of left operand is less than the
4. < value of right operand, if yes then condition becomes (a < b) is true.
true.
Checks if the value of left operand is greater than or
(a >= b) is not
5. >= equal to the value of right operand, if yes then
true.
condition becomes true.
Checks if the value of left operand is less than or equal
6. <= to the value of right operand, if yes then condition (a <= b) is true.
becomes true.

3. Logical Operators:
C Language supports the following logical operators – Logical Operators are used to
combine two or more Relational expressions in to a Logical expression. These Logical expressions
produce either True or False. Assume variable A holds 10 and B holds 20, then –
S.No Operator and Description
&& (Logical AND) If both the operands are non-zero, then the condition becomes true. Ex:
1
(A && B) is true.
|| (Logical OR) If any of the two operands are non-zero, then the condition becomes true. Ex:
2
(A || B) is true.
! (Logical NOT) Reverses the logical state of its operand. If a condition is true, then the
3
Logical NOT operator will make it false. Ex: !(A && B) is false.

4. BITWISE OPERATORS:
Bitwise Operators are used to perform operations on Bits and Bytes, these operations are
called Boolean Operations. C Language supports the following Bitwise Operators −Assume variable
A holds 2 and B holds 3, then
S.N Operator and Description
o
& (Bitwise AND) It performs a Boolean AND operation on each bit of its integer arguments. Ex: (A &
1
B) is 2.
| (BitWise OR) It performs a Boolean OR operation on each bit of its integer arguments. Ex: (A | B) is
2
3.
^ (Bitwise XOR) It performs a Boolean exclusive OR operation on each bit of its integer arguments.
3 Exclusive OR means that either operand one is true or operand two is true, but not both. Ex: (A ^ B) is
1.
~ (Bitwise Not) It is a unary operator and operates by reversing all the bits in the operand. Ex: (~B)
4
is -4.
5 << (Left Shift) It moves all the bits in its first operand to the left by the number of places specified in
the second operand. New bits are filled with zeros. Shifting a value left by one position is equivalent to
multiplying it by 2, shifting two positions is equivalent to multiplying by 4, and so on. Ex: (A << 1) is 4.
>> (Right Shift) Binary Right Shift Operator. The left operand’s value is moved right by the number of
6
bits specified by the right operand. Ex: (A >> 1) is 1.
>>> (Right shift with Zero) This operator is just like the >> operator, except that the bits shifted in
7
on the left are always zero. Ex: (A >>> 1) is 1.

5. ASSIGNMENT OPERATORS:
C Language supports the following assignment operators −
S.No Operator and Description
= (Simple Assignment ) Assigns values from the right side operand to the left side operand Ex: C = A
1
+ B will assign the value of A + B into C
+= (Add and Assignment) It adds the right operand to the left operand and assigns the result to the
2
left operand. Ex: C += A is equivalent to C = C + A
−= (Subtract and Assignment)It subtracts the right operand from the left operand and assigns the
3
result to the left operand. Ex: C -= A is equivalent to C=C–A
*= (Multiply and Assignment) It multiplies the right operand with the left operand and assigns the
4
result to the left operand. Ex: C *= A is equivalent to C = C * A
/= (Divide and Assignment) It divides the left operand with the right operand and assigns the result
5
to the left operand. Ex: C /= A is equivalent to C = C / A
%= (Modules and Assignment) It takes modulus using two operands and assigns the result to the
6
left operand. Ex: C %= A is equivalent to C = C % A

You might also like