Test Your Skills on C Operators

Practice Quiz

Practice Quiz
Practice quiz

Unlock the power of C programming by taking the quiz and embrace the confidence that comes with mastering this language. Believe in yourself, you've got this!

Before start, if you wish to refresh your knowledge on C operators, Click Here

1. What is the output of the following C code?

1
2
3
4
5
6
7
#include <stdio.h>
int main() {
    int x = 5;
    printf("%d ", x++);
    printf("%d", ++x);
    return 0;
}





2. What is the output of the following C code?

1
2
3
4
#include <stdio.h>
int main() {
    int x = 5;
    int y = ++x;
    printf("%d %d", x, y);
    return 0;
}





3. What is the output of the following C code?

1
2
3
#include <stdio.h>
int main() {
    int a = 10;
    int b = ++a;
    int c = a++;
    printf("%d %d %d", a, b, c);
    return 0;
}





4. What is the output of the following C code?

1
2
3
#include <stdio.h>
int main() {
    int a = 5;
    int b = 10;
    int result;
    result = a || b;
    printf("%d", result);
    return 0;
}





5. What is the output of the following C code?

1
2
3
#include <stdio.h>
int main() {
    int a = 5;
    int b = 10;
    int result;
    result = a && b;
    printf("%d", result);
    return 0;
}





6. What is the output of the following C code?

1
2
3
#include <stdio.h>
int main() {
    int a = 5;
    int b = 3;
    int result;
    result = a & b;
    printf("%d", result);
    return 0;
}





7. What is the output of the following C code?

1
2
3
#include <stdio.h>
int main() {
    int a = 5;
    int b = 3;
    int result;
    result = a | b;
    printf("%d", result);
    return 0;
}





8. What is the output of the following C code?

1
2
3
#include <stdio.h>
int main() {
    int a = 2;
    int b = 5;
    int result;
    result = a & b;
    printf("%d", result);
    return 0;
}





9. What is the output of the following C code?

1
2
3
#include <stdio.h>
int main() {
    int a = 6;
    int b = 3;
    int result;
    result = a & b;
    printf("%d", result);
    return 0;
}





10. What is the output of the following C code?

1
2
3
#include <stdio.h>
int main() {
    int a = 10;
    int b = 5;
    int result;
    result = a < b;
    printf("%d", result);
    return 0;
}





Thank you for giving your best to answer! To explore more chapters, click the button below:

Master C Programming Index

Comments

Popular posts from this blog

Chapter 2: Unlocking the World of C

Chapter 5: Tackling Typecasting, Decision Control in C

Chapter 4: Deep Dive into Operators in C