Or ( || ) in C++

or in c++

Learn what is || ( or ) and how to use it in C++ programming - Newbies.


Look at this Code block.

     | int a,b;
     | cout << " Enter 2 Numbers : ";
     | cin >> a >> b;
     | 

     | if (a==0 || a<b) {
     |   cout << "Invalid";
     |    }


in this code we say to program if " number a " is 0 Or " number a " is smaller than " number b "
print ( Publish ) Invalid.

Note : if the first condition was True , second condition does'nt check.

No comments

Powered by Blogger.