Hexadecimal to Binary conversion Each hex digit is in the range of [0-F]. To represent a hex digit, 4 bits are required. For example, have a look at the below combinations. Now, let’s consider the following binary value 52F To…
Decimal to binary As shown in the above statement, when we assign a decimal value to a variable, first the value is converted to binary from decimal value, and later it will be stored in computer memory space. Let’s see…
Octal to binary: We know that Octal values are base 8 values and we need 3 bits to represent each octal digit. Octal values can be easily converted to binary values by replacing each octal digit with its equivalent binary…
Binary to decimal conversion Consider a binary value with n binary digits, where ‘n’ is the position of a digit i.e. {0 to n} from LSB to MSB or Right to Left. The decimal value is equal to Example Binary…
What is a Binary value? Binary values are also known as Base 2 values. In a computer, all the information is stored in binary format. Example : (1001001010) Base 2 The reason why we are calling a binary value a…
In this article, we will discuss scanf: To read values from the console, we use the scanf() function. Scanf() is a pre-defined/in-built function that resides in the standard C library. Below is the prototype of the scanf() function Syntax: int…
The following image briefly explains the significant differences between local & global variables in C. Local variable Global variable 1. Variables declared inside the function. 1. Variables declared outside the function. 2. Scope is throughout the block. 2. Scope is…
What is a global variable? A variable declared outside of a function is known as a global variable. When a program starts its execution, storage gets allocated to the global variables in the “.data” section and will get de-allocated when…
Based on the scope and lifetime of a variable, variables are categorized into two types “Scope,” tells about visibility (i.e., from where and all places the variable is visible), whereas “lifetime,” tells about durability (till how much time the value…
Variables are the data objects which are used to store a value. These values can be manipulated during the program execution. We should declare the variable first before using it in our program. How to declare a variable? The Declaration…