#include #include void main() { int x = 12, y = 7, z = 2; z = x != 4 || y == 2; printf(“z = %d”, z); getch(); }  What will be the output of the program?

#include

#include

void main()

{

int x = 12, y = 7, z = 2;

z = x != 4 || y == 2;

printf(“z = %d”, z);

getch();

}

 What will be the output of the program?

A. z = 0

B. z = 1

C. z = 4

D. z = 3

Hướng dẫn

Chọn B là đáp án đúng

Xem lời giải

Xem lời giải

z = x != 4 || y == 2 = (x != 4) || (y == 2) = 1 || 0 = 1

 

Thư viện tài liệu12 Tháng bảy, 2023 @ 3:07 chiều

Đánh giá chủ đề này