Friday, 15 February 2013

while

§The statement is executed repeatedly as long as the expression is true (non zero)
The cycle continues until expression becomes zero, at which point execution resumes after statement
§If the test expression in a while loop is false initially, the while loop will never be executed
  int i = 1, sum = 0;
  while (i <= 10)
  {
  sum = sum + i;
            i= i + 1;
  }
  printf(“Sum = %d\n”, sum);



No comments:

Post a Comment

String functions

Read This: strncpy() strncat() strstr () strlen() — Predefined function defined in string.h . — — Returns the len...