int i = 1; int number, multi, remain; number = ??; int answer = 0; while(i != 5) { remain = number % 10; number= number/

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

int i = 1; int number, multi, remain; number = ??; int answer = 0; while(i != 5) { remain = number % 10; number= number/

Post by answerhappygod »

int i = 1;
int number, multi, remain;
number = ??;
int answer = 0;
while(i != 5)
{
remain = number % 10;
number= number/ 10;
multi = pow(10, 4- i);
answer = answer + (remain * multi);
I++;
Student ID number is 0094
Consider the while loop above, use the last 4 digits of your
Student ID for the variable number and fill in the blanks with the
content of each variable everytime the loop runs.
Write in values for each variable every iteration of the loop
you think will happen, if you think a run wil not happen, you can
fill up every variable in that run with NULL
Run 1
remain =
number =
multi =
answer =
i =
Run 2
remain =
number =
multi =
answer =
i =
Run 3
remain =
number =
multi =
answer =
i =
Run 4
remain =
number =
multi =
answer =
i =
Run 5
remain =
number =
multi =
answer =
i =
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply