Computer Science, asked by Vaibhavibisht192, 3 months ago

write a program to accept a number find and display all its factor including 1 including the number itself.

GIVE OUTPUT AND VARIABLE DESCRIPTION​

Attachments:

Answers

Answered by Mister360
0

Explanation:

#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;

}

Similar questions