The while statement
The simplest of all looping structure in C is the While Statement. The general format of the While Statement is:
while (test condition)
body of the loop
Here the given test condition is checked and if the condition is true then the body of the Loop is executed. After the execution of the body, the test condition is once again evaluated and if it is true, the body is executed once again. This process of repeated execution of the body continues until the test condition finally becomes false and the control is transferred out of the Loop.
On exit, the program continues with the statements immediately after the body of the Loop. The body of the Loop may have one or more statements. The braces are needed only if the body contained two are more statements.
printf("Enter a phrase whose length has to be found(terminated by enter key): \n");
printf("Length is: %d",x-1);
The above program returns the number of characters of a phrase or statement which is terminated by return key.
Below is the output of program :
Topics in C Programming
Urgenthomework helped me with finance homework problems and taught math portion of my course as well. Initially, I used a tutor that taught me math course I felt that as if I was not getting the help I needed. With the help of Urgenthomework, I got precisely where I was weak: