Advertisement
Guest User

Untitled

a guest
Nov 19th, 2019
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. bool a, b, c;
  8. cin>>a;
  9. cin>>b;
  10. cout<<"Warunek a||b: ";
  11. if(a||b)
  12. {
  13. c=true;
  14. cout<<c;
  15. }
  16. else
  17. {
  18. c=false;
  19. cout<<c;
  20. }
  21. cout<<endl;
  22. cout<<"Warunek a&&b: ";
  23. if(a&&b)
  24. {
  25. c=1;
  26. cout<<c;
  27. }
  28. else
  29. {
  30. c=0;
  31. cout<<c;
  32. }
  33. cout<<endl;
  34. cout<<"Warunek !(a&&b): ";
  35. if(!(a&&b))
  36. {
  37. c=1;
  38. cout<<c;
  39. }
  40. else
  41. {
  42. c=0;
  43. cout<<c;
  44. }
  45. cout<<endl;
  46. cout<<"Warunek !(a||b): ";
  47. if(!(a||b))
  48. {
  49. c=1;
  50. cout<<c;
  51. }
  52. else
  53. {
  54. c=0;
  55. cout<<c;
  56. }
  57. return 0;
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement