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, zExplanation / 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); }Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.