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

Please correct and write a program for the followingpseudocode. (What is wrong w

ID: 3610866 • Letter: P

Question

Please correct and write a program for the followingpseudocode. (What is wrong with this pseudocode and correct it withwriting the right program.)                       printf input z num                       scanf   x, y                         If (x > 0)                          If (y > 0)                           {                               z= x                              y = x + 1                             }                           else                             z = y                           else                            {                               y = x + 1                               z = 2 * x                             }                             scanf x, y, z Please correct and write a program for the followingpseudocode. (What is wrong with this pseudocode and correct it withwriting the right program.)                       printf input z num                       scanf   x, y                         If (x > 0)                          If (y > 0)                           {                               z= x                              y = x + 1                             }                           else                             z = y                           else                            {                               y = x + 1                               z = 2 * x                             }                             scanf x, y, z

Explanation / Answer

#include int main() {     int x = 0, y = 0, z = 0;     printf("Value of x: ");     scanf("%d", &x);         printf("Value of y: ");     scanf("%d", &y);         printf("Value of z: ");     scanf("%d", &z);     if (x > 0)     {         if (y > 0)         {            z = x;            y = x + 1;         }         else         {            z = y;         }     }     else     {         y = x + 1;         z = 2 * x;     }     printf("Value of z: %d", z);   }
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