C语言 $ ./factors Enter number: 1001 The factors of 1001 are: 1 7 11 13 77 91 143 1001Write a program factors.c which reads a number n from standard input and prints the factors of n. Compile it to produce an executable called factors.$ ./factorsEn

来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/23 05:49:55
C语言$./factorsEnternumber:1001Thefactorsof1001are:17111377911431001Writeaprogramfactors.cwhichreadsan

C语言 $ ./factors Enter number: 1001 The factors of 1001 are: 1 7 11 13 77 91 143 1001Write a program factors.c which reads a number n from standard input and prints the factors of n. Compile it to produce an executable called factors.$ ./factorsEn
C语言 $ ./factors Enter number: 1001 The factors of 1001 are: 1 7 11 13 77 91 143 1001
Write a program factors.c which reads a number n from standard input and prints the factors of n. Compile it to produce an executable called factors.
$ ./factors
Enter number: 1001
The factors of 1001 are:
1
7
11
13
77
91
143
1001

C语言 $ ./factors Enter number: 1001 The factors of 1001 are: 1 7 11 13 77 91 143 1001Write a program factors.c which reads a number n from standard input and prints the factors of n. Compile it to produce an executable called factors.$ ./factorsEn
#include
int main()
{
int n, i;
printf("Enter number:");
scanf("%d",&n);
printf("The factors of %d are:\n",n);
printf("1\n");
for(i=2; i