C++ Logical Operator How These Operators Work And Also Use of Boolalpha
#include<iostream>
using namespace std;
int main()
{
int i = 2, j = 3, k = 4 , m = 5;
cout <<boolalpha<< ( i == 1 ) << endl;
cout << ( j == 3 ) << endl;
cout << ( i >= 1 && j < 4 ) << endl;
cout << ( m <= 99 && k < m ) << endl;
cout << ( j >= i || k == m ) << endl;
cout << ( (k + m) < j || ( 3 - j ) >= k ) << endl;
cout << ( k + m < j || 3 - j >= k ) << endl;
cout << ( !m ) << endl;
cout << ( !(j - m) ) << endl;
cout << ( !( k > m) ) << endl;
system("pause");
}
*------------------------------------------------------------------------------------------------------*
#include hum is liya likhta hain taka hum ak header file ko samil kar saka. jasa ke "iostream" is program ma samil kia. header files ko is liya hum istimal karta hai q ka us ma pahla sa he kuch functions ko store karwa lia jata hai. Taka baad ma humay bar bar usay likhna na paray bs us ke header file ko shamil kar ka us function ko call kar lia jae .
0 comments:
Post a Comment