Question: Using C Programming for the following: Run the program below with the following values: #include int main(void) { int x, y, p, q; printf(Enter x

Using C Programming for the following:

Run the program below with the following values:
#include
int main(void)
{
int x, y, p, q;
printf("Enter x and y:");
scanf("%4d%5d", &x, &y);
printf("x=%d,y=%d", x, y);
printf("\nEnter p and q:");
scanf("%d%d", &p, &q);
printf("p=%d,q=%d", p, q);
return 0;
}
Enter the following values for x, y, p and q:
Enter x and y: 12345 6789
Enter p and q: 54321 9876
Analyze and explain the output.

but my output result is as follows:

Enter x and y:12345 6789 x=1234, y=5 Enter p and q:54321 9876

Why is it so?
 

Enter x and y:12345 6789 x=1234, y=5 Enter p and q:54321 9876 p=6789, q=54321 Process returned 0 (0x0) Press any key to continue. execution time: 11.322 s

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!