Q:

What is the result of each of these expressions

0

What is the result of each of these expressions?

unsigned long ul1 = 3, ul2 = 7;

(a) ul1 & ul2

(b) ul1 | ul2

(c) ul1 && ul2

(d) ul1 || ul2

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

#include <iostream>

int main() {
  unsigned long ul1 = 3, ul2 = 7;

  std::cout << (ul1 & ul2) << std::endl;  // 3
  std::cout << (ul1 | ul2) << std::endl;  // 7
  std::cout << (ul1 && ul2) << std::endl;  // 1, means true
  std::cout << (ul1 || ul2) << std::endl;  // 1, means true

  return 0;
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now