Q. What will be the output of the following C code?

Code:
#include <stdio.h>

int main()
{
    int x =-100;
    
    -100;
    printf("%d",x);
    
    return 0;
}
  • (A) 100
  • (B) -100
  • (C) 0
  • (D) Error
πŸ’¬ Discuss
βœ… Correct Answer: (B) -100
Explanation: The statement "-100;" is evaluated and this does not affect the value of "x".
Explanation by: Kanak Sharma
The statement "-100;" is evaluated and this does not affect the value of "x".

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
221
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Kanak Sharma
Publisher
πŸ“ˆ
88%
Success Rate