The following code shows how to Find All Factors of a Number in C.


                C program to find all factors of a number

#include <stdio.h>

int main()
    int i, n;
    printf("Enter a number: ");
    scanf("%d", &n);
    printf("The factors of %d are...\n", n);
    printf("%d ", 1);
            printf("%d ", i);
    printf("%d ", n);
    return 0;


Further Reading

50+ C Programming Interview Questions and Answers

C Program to Find Factorial of a Number