1157 Divisors I

SemiColon
By -
0
URI Online Judge | 1157

Divisors I

Read an integer N and compute all its divisors.

Input

The input file contains an integer value.

Output

Write all positive divisors of N, one value per line.
Input SampleOutput Sample
61
2
3
6


Solution:
#include <stdio.h>

int main()
{
   int n,i;
    scanf("%d",&n);
    for(i=1;i<=n;i++)
    {
        if(n%i==0)
            printf("%d\n",i);
    }
    return 0;
}


Tags:

Post a Comment

0Comments

Post a Comment (0)