#include <stdio.h>

int front = 0;
int rear = 0;
int que[1000];

void enque(int x){
    que[rear++] = x;
}

int deque(){
    return que[front++];
}

int size(){
    return rear - front;
}

int main() {

    int arr[] = {4, 8, 1, 9, 3};
    int n = 5;

    for (int i = 0; i < n; i++) {
        enque(arr[i]);
    }

    int target = 9;
    int count = 0;
    
    for(int i = 0;i < n;i++) {
        int x = deque();
        count++;

        if (x == target) {
            printf("%d", count);
        }
    }

    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: