//This is a simple program to see the function of if and else command.
//The program takes a number and tells how many digits it has.
#include <stdio.h>
#include <conio.h>
void main()
 {
 long int x;
 x=0;
 // *** The Main Body *** //
 clrscr();
 printf("Enter a number between 0 and 30000 please:\n");
 scanf("%d",&x);
 if(x>=0 && x<10)
	printf("Your number has 1 digit.");
 else if(x>=10 && x<100)
	printf("Your number has 2 digits.");
 else if(x>=100 && x<1000)
	printf("Your number has 3 digits.");
 else //This else relates to the last written if  (if x>=100 && x<1000)
	printf("Your number has more than 3 digits.");
 getch();
 }