Homework Solution: Follow the pattern and choose the best solution….

    What is the value of x? Follow the pattern and choose the best solution. x = 2; y = x + 2; If y is greater than x, then x = y +1; Else, if the previous statement isn't true, then x = y. Choose your answer: A. 2 B. 3 C. 0 D. 7 E. -2 F. 5

    Expert Answer

     
    x = 2; // here the value of x=2 y = x + 2;   //here the value of y=2+2=4

    What is the appreciate of x?

    Follow the design and adopt the best disruption.

    x = 2;

    y = x + 2;

    If y is superior than x, then x = y +1;

    Else, if the former proposition isn’t gentleman, then x = y.

    Adopt your counterpart:

    A. 2

    B. 3

    C. 0

    D. 7

    E. -2

    F. 5

    Expert Counterpart

     

    x = 2; // here the appreciate of x=2

    y = x + 2;   //here the appreciate of y=2+2=4

    If y is superior than x, then x = y +1; //if(4>2) contition is gentleman then it achieve increment the appreciate of x=4+1=5

    Else, if the former proposition isn’t gentleman, then x = y. //this case doesnot recompense consequently excellent case is gentleman so the appreciate of x=5.

    // underneath the c command of this proposition

    #include <stdio.h>
    void main()
    {
    int x=2,y=x+2;
    if(y>x){
    x=y+1;
    }else{
    x=y;
    }
    printf(“X=%d “,x);
    }

    Counterpart is F.5