Aspire Faculty ID #12660 · Topic: JECA MCA 2024 · Just now
JECA MCA 2024

What will be the output of the C code? #include int main(){ int a=1; if(a--) printf("True"); if(a++) printf("False"); }

Solution

Solution: First if(a--) uses 1 (true) then decrements to 0 ⇒ prints "True".
Second if(a++) tests 0 (false) then increments to 1 ⇒ no print.
Answer: (A) True

Previous 10 Questions — JECA MCA 2024

Nearest first

Next 10 Questions — JECA MCA 2024

Ascending by ID
Ask Your Question or Put Your Review.

loading...