/* EXPERIMENT - 2 */ /*AIM : TO CHECK WHETHER A GIVEN NUMBER IS DIVISIBLE BY 5 OR NOT. */ /* PROGRAMMER : SHEKHAR A. SHERIKAR */ /* COMPUTER TECHNOLOGY - CM102 (B3) */ main() { long int x; int z; z=1; while(z!=0) { clrscr(); printf("\n\n\n\n\n\t\t This program will help you to check whether a"); printf("\n\t\t given number is divisible by 5 or not."); printf("\n\n\t\t\t\tEnter the number:"); scanf("%ld",&x); printf("\n\n\n\t\t\t\t A N S W E R"); if(x%5==0) /*To check wheather the number is divisible by 5*/ /*If the number is divisible, the following statement is executed:*/ printf("\n\n\t\t\t The number %ld is divisible by 5.\n",x); else /*If the number is not divisible, the following statement is executed*/ printf("\n\n\t\t\tThe number %ld is not divisible by 5.\n",x); printf("\n\n\n\t\t\tType 1 to Continue & 0 to Exit : "); scanf("%d",&z); getch(); } }