I wrote program that can print number according to user input How to fix length of user input.I want to fix length of user input. I want to write program where user can print only any four numbers. How to fix length of user input ?

Code:
#include<stdio.h>
int main (void)
{
  int i;
  printf("user input");
  scanf ("%d",&i);
  printf ("Number's %d \n", i);    
  return 0;
}