Question: C PROGRAM & ASSEMBLY #define PUSH 01 #define POP 02 The #denne values are in decimal e!! You need to do something, so that this
C PROGRAM & ASSEMBLY


#define PUSH 01 #define POP 02 The #denne values are in decimal e!! You need to do something, so that this type of case can be handled Assume that you have an array of 20 elements. These are stored in the memory sequentially Some of the numbers are even and some are odd. In this array, even and odd numbers are considered as pairs. While parsing the array sequentially, then if you find out one even and one odd, then they form a pair. After parsing the whole 20 elements, you need to print out the unpaired even numbers. (50 marks) Example 4 14 5 34 12 3 55 28 34 42 37 28 While parsing, first find out the starting of the even number. Which is in this case 4. Push 4 14 comes another even. o Stack: 4 -14 5 comes, remove 14 . 34 comes, push 34; . 12 comes, push 12; o Stack: 4 o Stack: 4 -34 o Stack 4->34-12 3 comes, remove 12; o Stack 4->34 55 comes, remove 34; o Stack 4 . 28 comes, push 28; o Stack 4->28 34 comes, push 28; o Stack 4->28-34 42 comes, push 28; *
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
