C examples for Statement:do while
Read in value with do while loop
#include <stdio.h> int main(void) { const int secret_code = 13; int code_entered; /* w ww . j a v a 2 s . co m*/ do { printf("Guess a number: "); scanf("%d", &code_entered); } while (code_entered != secret_code); printf("from boo k 2s.com!\n"); return 0; }