Tuesday, 24 March 2015

if logic in C++ , the output will not display if zero of false in side bracket

if logic in C++    if logic in C++ , the output will not display if zero of false in side bracket #include<iostream.h> int main... thumbnail 1 summary

if logic in C++  

 if logic in C++ , the output will not display if zero of false in side bracket

#include<iostream.h>
int main()
{
    if(0)
  cout<<" one "<<endl;
  if(false)
  cout<<" two "<<endl;
  if(-3)
  cout<<" three "<<endl;
  if(5)
  cout<<" four "<<endl;
  if(true)
  cout<<" five "<<endl;
  if(2.5)
  cout<<" six "<<endl;
  if('a')
  cout<<" seven "<<endl;
  if(0.3)
  cout<<" eghit "<<endl;
    system("pause");
    return 0; 
    }
 output will be three four five six seven eight