Write a C program to implement a queue using two stacks and process enqueue/dequeue queries.
First line contains n queries. Subsequent lines contain query type (1 val for enqueue, 2 for dequeue and print dequeued value).
Print dequeued values each on a new line.
1 <= n <= 100
5 1 10 1 20 2 1 30 2
10 20
Maintain s1 for enqueue operations and s2 for dequeue. Transfer elements from s1 to s2 when s2 is empty.
#include <stdio.h>
#include <stdlib.h>
int main() {
int n;
if (scanf("%d", &n) == 1) {
// Write your code here to implement queue using two stacks
}
return 0;
}Embedded systems rely on efficient low-level programming to interact directly with hardware. In this course, you will learn how to write practical Embedded C programs used in real microcontroller-based systems. Rather than focusing only on theory, this course follows a practice-driven approach. Each lesson includes hands-on coding exercises that simulate real firmware development tasks used