Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

6) For the following C-Code assume Header Files and Libraries and been accounted

ID: 3732284 • Letter: 6

Question

6) For the following C-Code assume Header Files and Libraries and been accounted for previously in the program. Further assume that a

For the C-Code below please answer the following questions:

By what value does i increment ___________

How many cycle are executed _______________

What is the final value of B _______________

int A = 3;

int B = 0;

void main()

{  

    for(int i=0;i<10;i++){

       B = B + (A + 3) – 1;     

    }

}

For the C-Code below please answer the following questions:

By what value does i increment ___________

How many cycle are executed _______________

What is the final value of Y _______________

int X = 4;

int Y = 0;

void main()

{  

    for(int i=5;i<10;i++){

       Y = Y + (X -1) + 8;     

    }

}

For the C-Code below please answer the following questions, provide solutions in both Decimal and Binary:

V = ____________10              V = _____________________2

W = ____________10             W = ____________________2

X = _____________10          X = ______________________2

What is the name of these Operators (There is only one answer) _________________________

int V = 0;

int W = 0;

int X = 0;

unsigned int Y = 73;

unsigned int Z = 17;

void main()

{  

    V = Y & Z;

    W = Y | Z;

    X = Y ^ Z;

}

Explanation / Answer

a)

By what value does i increment: 1

How many cycle are executed: 10

What is the final value of B : 50

b)

By what value does i increment : 1

How many cycle are executed: 5

What is the final value of Y: 55

c)

V = (1)10              V = (00000001)2

W = (89)10             W = (1011001)2

X = (88)10          X = (1011000)2

These are Bitwise Operators

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote