Write a program. To find the factor of given integer by using function
Answers
Answered by
0
Answer:
#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
Science,
5 months ago
Psychology,
5 months ago
Social Sciences,
5 months ago
Social Sciences,
1 year ago
Art,
1 year ago