Question: Problem 7 Consider the function provided. Answer the questions with one sentence each. 1 unsigned int foo ( unsigned byte x ) 2 { 3

Problem 7 Consider the function provided. Answer the questions with one sentence each.
1 unsigned int foo (unsigned byte x)
2{
3 int i;
4 int r=1;
5 for(i=1;i<=x;i++){
6r=r*i;
7}
8 return(r);
9}
a) What does unsigned int in Line 1 indicate?
b) What is the largest possible input (in decimal) that can be passed to this function?
c) How many times will Line 6 be executed when this function is called?
d) What effect would replacing Line 4 with int r=0x0001; have?
e) What does this function do?

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 Programming Questions!