Posts

Showing posts from March, 2024

OPERATORS IN C

Image
Operators in C Operators are the foundation of programming language. C language provide different kind of operators. Different types of operators in C are : 1.  Arithmetic operators 2.  Relational operators  3.  Logical operators 4.  Assignment operators 5.  Increment and decrement operators   6.  Conditional operators 7.  Bitwise operators 8.  Special operators Arithmetic Operators Arithmetic operators are binary operators which are used to perform arithmetic operation. These are : +   add -   subtract *   multiply /    divide( divisor must be non zero )  %  modulo(gives remainder after division. The parenthesis() are used to clarify complex operations. The operators + and - can be used as unary plus and unary minus arithmetic operators also.  The unary – negates the sign of its operand . Note : C language has no operator for exponentiation. The function pow(x,y) which exists in header file m...

DATA TYPES AND OPERATORS IN C

Image
       CHAPTER 2 DATA TYPES , USER I/O OPERATORS  DATA TYPES Thedatatypespecifythetypeofdatathatavariablecanstore. •  A datatype is used to: •  Identify the type of a variable when the variable is declared  •  Identify the type of the return value of a function •  Identify the type of a parameter expected by a function •  ANSI C supports three classes of data types . 1. Primary or Fundamental data types.  2. User-defined data types. 3. Derived data types. Primary Data Types C provides 5 primary or fundamental data types Character- char  integer- int floating point -float double void. Extended data type We can also use the short, long, signed and unsigned keywords to extend the primary data types .  So, they are called extended data types Primary Data Types in C Integer Types   Size and Range Of Data types on 16 bit machine Floating Point Types VOID The void data type is generally used with function to denote that...

INTRODUCTION TO C

Image
HISTORY  OF  C  LANGUAGE C is developed by Dennis Ritchie in the year 1972 at Bell Laboratories(USA). •  It is a General- purpose, Structured, Machine Independent, Simple and Flexible programming language. •  Initially, C language was developed to be used in UNIX operating system. It inherits many features of previous languages such as B and BCPL. PROGRAM  DEVELOPMENT  STEPS   The program development steps or phases that we follow a sequence of steps to develop a program in any programming language.   Generally, the program development steps contains 6 phases, they      are as follows  Requirements  Analysis  Design  Coding  Testing  Maintenance FEATURES  OF  C  LANGUAGE Simple   Machine Independent or Portable   Mid-level programming language  S tructured programming language    Rich Library  Memory Management   Fast Speed  Pointers   Rec...