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

C Language:: Data Types Operators Expressions Instructions Assignments Operators

The document discusses various data types, operators, expressions, and instructions in the C programming language. It describes primary data types like integers, floating point numbers, characters, and void. Secondary data types include arrays, pointers, structures, unions, and enums. It also outlines unary, binary, ternary, and punctuation operators. Finally, it mentions the three types of instructions in C: type declaration, arithmetic, and control instructions as well as assignment operators.

Uploaded by

Carl Kevin Ola
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views

C Language:: Data Types Operators Expressions Instructions Assignments Operators

The document discusses various data types, operators, expressions, and instructions in the C programming language. It describes primary data types like integers, floating point numbers, characters, and void. Secondary data types include arrays, pointers, structures, unions, and enums. It also outlines unary, binary, ternary, and punctuation operators. Finally, it mentions the three types of instructions in C: type declaration, arithmetic, and control instructions as well as assignment operators.

Uploaded by

Carl Kevin Ola
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 22

C Language:

Data Types Operators Expressions Instructions Assignments Operators

Data Types In C Language


1) Primary Data Types
2) Secondary Data Types

Primary Data Types

INTEGER These are whole numbers, both positive and negative. Unsigned integers(positive values only) are also supported. In addition, there are short and long integers. FLOATING POINT These are numbers which contain fractional parts, both positive and negative, and can be written in scientific notation.

DOUBLE These are floating point numbers, both positive and negative, which have a higher precision than float variables. CHARACTER These are single characters. VOID It has no values therefore we cannot declare it as variable as we did in case of integer and float.

Secondary Data Types

Array in C programming An array in C language is a collection of similar data-type, means an array can hold value of a particular data type for which it has been declared. Pointers in C Programming A pointer is a secondary data type (also known as derived data type) in C. It is built from one of the primary data types available in C language.

Structure in Programming C structure is nothing but collection of different related data types. If we are using C structure then we are combining different related data types in one group so that we can use and manage those variables easily.

Union in Programming Unions like structure contain members whose individual data types may differ from one another.

Enum in Programming An enumeration consists of a set of named integer constants. An enumeration type declaration gives the name of the (optional) enumeration tag and defines the set of named integer identifiers.

Operators in C Language:

1) Unary Operators
Referencing operator ('&') Dereferencing operator ('*') Unary plus and minus operators ('+' and '-')

Increment operator ('++')


Decrement operator ('--') Logical negation operator ('!') Bitwise complement operator ('~')

2) Binary Operators
Binary plus and minus operators ('+' and '-')

Multiplicative operators ('*', '/' and '%')


Bitwise shift operators ('<<' and '>>') Logical and bitwise operators ('&', '^', '|', '&&' and '||')

Assignment operators ('=' etc.)


Relational operators ('<', '>', '<=' and '>=') Equality operators ('==' and '!=') Selection (structure-access) operators ('.' and '->')

3) Ternary Operators
Conditional operator ('? :')

4) Punctuators
Array subscript operator ('[...]') Parentheses operators ('(...)')

Braces ('{...}')
Equal sign ('=') Comma operator and punctuator (',')

Semicolon (';')
Colon (':') Asterisk ('*') Quotes ('"..."') Ellipsis ('...') Typecast ('(type)')

Instructions in C language

Three types of instructions in C:


1) Type Declaration Instruction 2) Arithmetic Instruction

3) Control Instruction

1) Type Declaration Instruction


To declare the Type Of Variables used in a C program.

2) Arithmetic instruction:
To perform arithmetic operations between constants and variables.

3) Control instruction:
To control the sequence of execution of various statements in a C program.

Assignment Operators

You might also like