Pointers in C

A pointer is a variable that contains the address of a variable. Pointers are much used in C, partly because they are sometimes the only way to express a computation, and partly because they usually lead to more compact and efficient code than can be obtained in other ways Pointer Notation Consider the declaration int … Read more

do-while Loop in C

There is a minor difference between the working of while and do-while loops. This difference is the place where the condition is tested. The while tests the condition before executing any of the statements within the while loop. As against this, the do-while tests the condition after having executed the statements within the loop The … Read more

Loops in c – While loop – For loop

The versatility of the computer lies in its ability to perform a set of instructions repeatedly. This involves repeating some portion of the program either a specified number of times or until a particular condition is being satisfied This repetitive operation is done through a loop control instructions There are three methods by way of … Read more

Use of Logical Operators in C

C allows usage of three logical operators, namely, &&, || and !. These are to be read as ‘AND’ ‘OR’ and ‘NOT’ respectively Consider the following example The marks obtained by a student in 5 different subjects are input through the keyboard. The student gets a division as per the following rules Percentage above or … Read more