Find the output of a program. #include<stdio.h> #define N 7 void main(){ char str[] = "abpqx"; for(int i=0; i<N-2; i++) if(i%2) printf("%d "…

Find the output of a program.

#include<stdio.h>
#define N 7
void main(){
    char str[] = "abpqx";
    for(int i=0; i<N-2; i++)
        if(i%2) printf("%d ", str[i]++);
        else    printf("%d ", str[i]--);
}

From the BTCL Assistant Manager (Technical) 2017 – Written exam, question 4 of 8.

More from this paper