Programming Code Center(PCC)
[C]

(PCC)::[How-to-write-a-C-Program-to-Display-Factors-of-a-Number]::[c]

File Name : Factors_of_Number.c

//Factors of a Positive Integer
#include <stdio.h>
int main() {
    int num, i;
    printf("Enter a positive integer: ");
    scanf("%d", &num);
    printf("Factors of %d are: ", num);
    for (i = 1; i <= num; ++i) {
        if (num % i == 0) {
            printf("%d ", i);
        }
    }
    return 0;
}

Output :

Factors_of_Number.jpg