Posts

Showing posts from June, 2015

C Program to find divisors of a given Integer

Image
Sorry for not bringing enough contents in this summer. Well, I was busy.                                                           Image Source Today we will learn a C program which can calculate the divisors of a given number. It is easy. You can see the Source Code below...   //Program for finding integer divisors of an number #include<stdio.h> void main() {     int num,div,ans;     printf("Enter the number\n");     scanf("%d",&num);     for(div=2;div<=num;div++)         if(num%div==0)         printf("The divisor is %d\n",div); } A view on the sample output of the program....   That's enough for today, Bye. I will return soon with another post. stay tune.