Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cstdlib>
- using namespace std;
- //主程式
- int main()
- {
- bool r1,r2; //變數宣告
- //關係運算子
- r1 = ((5 == 5)&&(3>6)); //false(true && false)
- r2 = ((5 == 5)||(3>6)); //true(true || false)
- cout << "((5 == 5)&&(3>6)) = " << r1 << "\n";
- cout << "((5 == 5)||(3>6)) = " << r2 << "\n";
- int i;
- float f =3.1415;
- cout << "f = "<< f << "\n";
- i = (int) f;
- cout << "i = " << i << "\n";
- system("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement