Binary arithmetic is simpler to learn because binary number system deals with only two digits - 0 and 1. Binary number perform all arithmetic operation such as Addition, Substraction, Multiplication and compliment as in decimal number system. Binary Addition The addition table for binary arithmetic consist of only the following four entries: 0+0=0 0+1=1 1+0=1 1+1=0 , plus a carry of 1 to the next column. 1011 + 1100 10111 1100 + 1100 11000 Binary Substraction There are three ways to do substraction between binary numbers:- 1. Simple Substraction 2. Substraction using 1's Complement 3. Substraction using 2's Complement Simple Substraction: The complete table of binary substraction is as follows: 0-0=0 0-1=1, borrow 1 from next column 1-0=1 1-1=0 1101 - 0101 1000 1001 - 0111 0...
Structure/Syntax of C program Syntax: The syntax of a language describes the possible combinations of symbols that form a correct program. Preprocessor Directive: In C programming, a preprocessor directive is a command that instructs the compiler to perform specific actions before the actual compilation of the source code begins. Preprocessor directives start with the '#' symbol and are processed by the preprocessor, a built-in component of the C compiler. They are not part of the C language itself, but they are essential for performing various tasks before the actual code is compiled. Common preprocessor directives- #include: Used to include header files into the source code, allowing the program to access functions and declarations defined in those header files. #define: Used to define constants, macros, or function-like macros for use throughout the program. #ifdef, #ifndef, #else, #endif: Used for conditional compilation, allowing certain c...