The do…while Loop in Java

A do…while loop is similar to the while looping construct aside from that a do…while circle is ensured to execute no less than one time. The syntax for this looping construct is as follows: do { /Statements }while(<booleanexpression>); Perceive that the Boolean declaration shows up toward the end of the circle, so the code execute … Read more

The while Loop in Java

A while loop is a control structure that permits you to rehash an errand a specific number of times. The syntax for this construct is as follows: while(boolean_expression) { /Statements } At the point when executing, if the boolean_expression result is genuine, then the activities inside the circle will be executed. This will proceed till … Read more

C – while loop in C programming

A loop is used for executing a block of statements repeatedly until a given condition returns false. In the previous tutorial we learned for loop. In this post we will learn while loop in C. while loop Syntax of while loop: while (condition test) { //Statements to be executed repeatedly // Increment (++) or Decrement … Read more

C program to convert Celsius to Fahrenheit using while loop

To convert Celsius to Fahrenheit #include <stdio.h> #include <stdlib.h> int main() { float celsius, fahrenheit; printf(“\nEnter temperature in celsius: “); scanf(“%f”, &celsius); fahrenheit = (1.8) * celsius + 32; printf(“\n%f deg celsius is %f fahrenheit\n”, celsius, fahrenheit); return 0; }