Question

Question 1 Consider the following 32-bit IEEE 754 floating point number. The binary number has been...

Question 1

  1. Consider the following 32-bit IEEE 754 floating point number. The binary number has been separated into the sign, exp and frac fields

Sign = 1           exp = 1000 0001           frac= 1111 0000 0000 0000 0000 000

Convert this number to decimal. Recall that the bias is 127 for IEEE single precision.

  1. Consider the following working C code.

For(i = 0; I < 3: i++)

            For(j = 0; j<=I; j++)

                        Arr[i][j] = i + j;

  1. Sketch arr
  2. Show all memory blocks allocated
  3. Show the index of each and every element
  4. Show the value stored in each element after the for loop

  1. Consider the following C statements.

int j = 1, k = 49, n[3];

int *p;

p = &j;

k=*p;

p = &n[2];

*p = k;

n[k] = *p--;

What is the value of:

  1. j
  2. *p
  3. N[k]
  1. Consider the list of files in a working directory called “testing”: a.out, gcc and bitfield.s

Write a Linux command that moves(copies and removes the original) gcc to “comp202”, a sub-directory of the current working directory.

Homework Answers

Answer #1

Ans b,c,d:

for(i = 0; I < 3: i++){

for(j = 0; j<=I; j++){

// To see the values of each each index and each value stored

cout << i << " " << j << " " << arr[i][j]

                       Arr[i][j] = i + j;

}

}

// Sketch arr

for(i = 0; I < 3: i++){

for(j = 0; j<=I; j++){

// To see the values of each stored at each index.

cout << i << " " << j << " " << arr[i][j] ;

}

}

Ans C - For C Statements

O/p is

j = 1

*p = 1

n[k] = 1

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT