loop in c
The 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. … Read more
The Odd Loop in C
Uses of Odd Loop In real life programming one comes across a situation when it is not known beforehand how many times the statements in the loop are to be executed. This situation can be programmed as shown below: /* Execution of a loop an unknown number of times */ main( ) { char another … Read more
Write down the simple interest program using for loop in c
Here a C program to calculate simple interest using for loop. main ( ) { int p, n, count ; float r, si ; for ( count = 1 ; count <= 3 ; count = count + 1 ) { printf ( “Enter values of p, n, and r ” ) ; scanf ( … Read more
The For loop in C
For loop is probably the most popular looping instruction. The for allows us to specify three things about a loop in a single line: Setting a loop counter to an initial value. Testing the loop counter to determine whether its value has reached the number of repetitions desired. Increasing the value of loop counter each time the … Read more
The loop Control Structure in C
The programs that we have learned/developed in this tutorial so far used either a sequential or a decision control instruction. In the first one, the calculations were carried out in a fixed order, while in the second, an appropriate set of instructions were executed depending upon the outcome of the condition being tested (or a logical … Read more