C examples for Statement:while
Reversing the Digits of a Number
#include <stdio.h> int main (void) { int number, right_digit; printf("Enter your number.\n"); scanf ("%i", &number); while (number != 0) {//from w ww.ja va 2 s . co m right_digit = number % 10; printf ("%i", right_digit); number = number / 10; } printf("\n"); return 0; }