Question: . [a] What does this program do? [b] Rewrite the code using appropriate variable names, indentation, and comments. #include main() { int a, b, c,

. [a] What does this program do?

[b] Rewrite the code using appropriate variable names, indentation, and comments.

#include

main()

{

int a, b, c, d;

a = 0;

while (1)

{

printf ("%d ", a);

printf ("Input? ");

scanf ("%d", &c);

if (c == 0) break;

d = 0;

for (b=1; b<=c; b++)

if (c % b == 0) d++;

if(d==2 || c==1) a = a + c;

}

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!