dimanche 20 août 2017

Why am I getting this output in C++? Explain the logic

#include <stdio.h>
#include <iostream>
int main() 
{
  if(NULL)
    std::cout<<"hello";
  else
    std::cout<<"world";
  return 0;
}

The output to the above question is:

world

Kindly explain me why am I getting this output. I am not able to get the satisfactory answer even after referring to several different sources.

Aucun commentaire:

Enregistrer un commentaire