The continue Statement in C

C Programming Tutorial

The keyword continue allows us to take up the control to the beginning of the loop, bypassing the statements inside the loop, which have not yet been executed. When continue is encountered inside any loop, control automatically passes to the beginning of the loop. A continue is usually associated with an if. Let’s consider the following … Read more

The break Statement in C

break statement in c

While writing C program, We often come across situations where we want to jump out of a loop instantly, without waiting to get back to the conditional test. The keyword break allows us to do this. When break is encountered inside any loop, control automatically passes to the first statement after the loop. A break … Read more

The Odd Loop in C

the odd loop in

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

Nesting of Loops in C

nesting of loop

The way if statements can be nested, similarly whiles and for can also be nested. To understand how nested loops work, look at the program given below: /* Example of nested loops */ main( ) { int r, c, sum ; for ( r = 1 ; r <= 3 ; r++ ) /* outer loop … Read more

Download C / C ++ IDE – C program editor

turbo-c

C-Free is a professional C/C++ integrated development environment (IDE) that support multi-compilers. Use of this software, user can edit, build, run and debug programs freely. With C/C++ source parser included, although C-Free is a lightweight C/C++ development tool, it has powerful features to let you make use of it in your project. C-Free Packages package name: … Read more

Write down the simple interest program using for loop in c

C Programming Tutorial

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

C Programming Tutorial

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 While loop in C

C Programming Tutorial

It is often the case in programming that you want to do something a fixed number of times. Perhaps you want to calculate gross salaries of ten different persons, or you want to convert temperatures from centigrade to Fahrenheit for 15 different cities. Let us look at a example which uses a while loop. The … Read more

The loop Control Structure in C

turbo-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

The Conditional Operators in C

C Programming Tutorial

The conditional operators ? and : are sometimes called ternary operators since they take three arguments. In fact, they form a kind of foreshortened if-then-else. Their general form is, expression 1 ? expression 2 : expression 3 What this expression says is: “if expression 1 is true (that is, if its value is non-zero), then … Read more