Q. What will be the output?

Code:
#include <stdio.h>
int main() {
    int x = 1;
    if (x = 0)
        printf("Zero");
    else
        printf("Not Zero");
    return 0;
}
  • (A) Zero
  • (B) Not Zero
  • (C) Error
  • (D) Nothing
πŸ’¬ Discuss
βœ… Correct Answer: (B) Not Zero
Explanation: x = 0 assigns 0, which is false, so 'Not Zero' is printed.
Explanation by: Mr. Dubey
x = 0 assigns 0, which is false, so 'Not Zero' is printed.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
81
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
96%
Success Rate