Question: #include #include int main() { unsigned int i1, i2; unsigned int student_id = 1236234; int j, k; system(dir); printf( xx = %d , (student_id %

 #include #include int main() { unsigned int i1, i2; unsigned int

#include
#include
int main()
{
unsigned int i1, i2;
unsigned int student_id = 1236234;
int j, k;
system("dir");
printf(" xx = %d ", (student_id % 255) & 0xfe);
for (j=0; j
// Generate pseudo-random 'info' bits
i1 = (student_id * (j+2)) ^ student_id;
// Reduce the number of bits in data and set LSB to zero
i2 = i1 & 0xffff;
i1 >>= 16;
i1 += i2;
i1 &= 0xfffe;
// i1 now contains a zero in bit 0, and 'info' bits from bit 1 to
// bit 15. -----------------------------------------------------
// Begin mystery block -----------------------------
i2 = i1;
for (k=15; k>0; k--)
i2 = i2 ^ (i1 >> k);
i2 = i2 & 1;
// End mystery block -------------------------------
i1 = i1 | i2;
printf("0x%x ",i1);
}
return 0;
}
1. (8 pts.) Download the source code file (mystery.c). Open the file using a text/programming editor, review the code, assign your student ID number to the student_id variable as indicated in the comments, compile and run the program. (a) Submit all the output produced by the program in a text file. Take note of the printed value of "xx", to be used in Problem 3. (b) Explain what is the purpose of the code in the "mystery block" or, in other words, what is the value calculated in i2

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!