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

Control Instructions in C

Control Instructions enable us to specify the order in which the various instructions in a program are to be executed by the computer. In other words the control instructions determine the ‘flow of control’ in a program. There are four types of control instructions in C. They are: Sequence Control Instruction Selection or Decision Control … Read more