Divisors
Limits
1s, 512 MB
Read an integer variable and print all of its divisors (including 1 and the number itself).
Input
The input will contain an integer A (0 < A < 100).
Output
Print the divisors in increasing order, one per line.
#include<stdio.h>
int main()
{
int n,i;
scanf("%d", &n);
i=1;
while(i<=n)
{
if(n%i==0)
printf("%d\n",i);
i++;
}
return 0;
}