Tìm kiếm:
TRANG NHÀ
Giới thiệu VNEDU.ORG
Điều khoản và bản quyền
Liên lạc VNEDU
TRẮC NGHIỆM TRỰC TUYẾN
---Công Cụ:---
Soạn Biểu thức
Bảng màu HTML
Ký hiệu đặc biệt 01
Ký hiệu đặc biệt 02
Ký hiệu đặc biệt 03
Ký hiệu đặc biệt 04
Ký hiệu đặc biệt 05
Ký hiệu đặc biệt 06
Ký hiệu đặc biệt 07
Ký hiệu đặc biệt [Toán]
Tin Học   ||  Căn Bản    Văn Phòng    Hệ Thống - Mạng    Phần Mềm Ứng Dụng    Kỹ thuật số    Lập trình    SQL  

Trắc Nghiệm Ngôn Ngữ Lập Trình C ( English ) - Bài 51
Ngày làm bài: Hôm nay lúc 23:59:10 (Server time)
Số câu hỏi: 10.   Tổng điểm: 10
Yêu cầu hoàn thành: 60 phút.
Thời gian còn lại: 
Cỡ chữ câu hỏi:  Cỡ chữ đáp án:


1-
What will be the output of the program?
#include<stdio.h>

int main()
{
    unsigned int res;
    res = (64 >>(2+1-2)) & (~(1<<2));
    printf("%d\n", res);
    return 0;
}

  A - 
32
  B - 
64
  C - 
0
  D - 
128
2-
What will be the output of the program ?
#include<stdio.h>

int main()
{
    int i=4, j=8;
    printf("%d, %d, %d\n", i|j&j|i, i|j&&j|i, i^j);
    return 0;
}

  A - 
4, 8, 0
  B - 
1, 2, 1
  C - 
12, 1, 12
  D - 
0, 0, 0
3-
Which of the following statements are correct about the program?
#include<stdio.h>

int main()
{
    unsigned int num;
    int i;
    scanf("%u", &num);
    for(i=0; i<16; i++)
    {
        printf("%d", (num<<i & 1<<15)?1:0);
    }
    return 0;
}

  A - 
It prints all even bits from num
  B - 
It prints all odd bits from num
  C - 
It prints binary equivalent num
  D - 
Error
4-
Which of the following statements are correct about the program?
#include<stdio.h>

int main()
{
    unsigned int num;
    int c=0;
    scanf("%u", &num);
    for(;num;num>>=1)
    {
        if(num & 1)
            c++;
    }
    printf("%d", c);
    return 0;
}

  A - 
It counts the number of bits that are ON (1) in the number num.
  B - 
It counts the number of bits that are OFF (0) in the number num.
  C - 
It sets all bits in the number num to 1
  D - 
Error
5-
Which of the following statements are correct about the program?
#include<stdio.h>
char *fun(unsigned int num, int base);

int main()
{
    char *s;
    s=fun(128, 2);
    s=fun(128, 16);
    printf("%s\n",s);
    return 0;
}
char *fun(unsigned int num, int base)
{
    static char buff[33];
    char *ptr = &buff[sizeof(buff)-1];
    *ptr = '\0';
    do
    {
        *--ptr = "0123456789abcdef"[num %base];
        num /=base;
    }while(num!=0);
    return ptr;
}

  A - 
It converts a number to a given base.
  B - 
It converts a number to its equivalent binary.
  C - 
It converts a number to its equivalent hexadecimal.
  D - 
It converts a number to its equivalent octal.
6-
Which of the following statements are correct about the program?
#include<stdio.h>

int main()
{
    unsigned int m[] = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80};
    unsigned char n, i;
    scanf("%d", &n);
    for(i=0; i<=7; i++)
    {
        if(n & m[i])
            printf("yes");
    }
    return 0;
}

  A - 
It will put OFF all bits that are ON in the number n
  B - 
It will test whether the individual bits of n are ON or OFF
  C - 
It will put ON all bits that are OFF in the number n
  D - 
It will report compilation errors in the if statement.
7-
Left shifting a number by 1 is always equivalent to multiplying it by 2.
  A - 
True
  B - 
False
8-
In the statement expression1 >> expression2. if expression1 is a signed integer with its leftmost bit set to 1 then on right shifting it the result of the statement will vary from computer to computer
  A - 
True
  B - 
False
9-
Bitwise & and | are unary operators
  A - 
True
  B - 
False
10-
Bitwise & can be used to check if more than one bit in a number is on.
  A - 
True
  B - 
False
 
[Người đăng: Thành Lãm - ST]
Ghé thăm Kênh của Vị Sư "hai lần chết đi sống lại"
Tu Si Chau Soc Thon

https://www.youtube.com/channel/UCoyC9WTTVR-M3qpTKKEXGnQ

Chau Soc Thon Official Channel


Phong Bảo Official
Phong Bao Official
Xem Nhiều nhất
Trắc Nghiệm Pascal - Bài 20
Trắc Nghiệm ASP.NET - Bài 12
Trắc Nghiệm Ngôn Ngữ Lập Trình C - Bài 16
Trắc Nghiệm ASP.NET - Bài 01
Trắc Nghiệm ASP.NET - Bài 03
Trắc nghiệm C++ - Bài 18
Trắc Nghiệm C# - Bài 53
Trắc Nghiệm ASP.NET - Bài 02
Trắc Nghiệm C# - Bài 42
Trắc Nghiệm Java - Bài 01
Trắc Nghiệm ASP.NET - Bài 04
Trắc Nghiệm Pascal - Bài 22
Trắc Nghiệm ASP.NET - Bài 13
Trắc Nghiệm ASP.NET - Bài 09
Trắc Nghiệm ASP.NET - Bài 08
Trắc nghiệm PHP - Bài 01
Trắc Nghiệm ASP.NET - Bài 06
Trắc Nghiệm ASP.NET - Bài 11
Trắc Nghiệm ASP.NET - Bài 05
Trắc Nghiệm ASP.NET - Bài 23
Đề Xuất
Trắc Nghiệm Thiết Kế Web Và Flash - Bài 33
Trắc Nghiệm Java - Bài 03
Trắc Nghiệm Thiết Kế Web - Bài 05
Trắc Nghiệm Visual Basic - Bài 12
Trắc Nghiệm Thiết Kế Web (English) - Bài 01
Trắc Nghiệm Thiết Kế Web (English) - Bài 12
Trắc Nghiệm Ngôn Ngữ Lập Trình C - Bài 24
Trắc Nghiệm Ngôn Ngữ Lập Trình C ( English ) - Bài 81
Trắc Nghiệm Thiết Kế Web (English) - Bài 15
Trắc nghiệm Linux ( English ) - Bài 25
Trắc Nghiệm Visual Basic - Bài 21
Trắc nghiệm Ngôn Ngữ Lập Trình C++ - Bài 17
Trắc Nghiệm C Sharp - Bài 10
Trắc nghiệm Ngôn Ngữ Lập Trình C++ - Bài 18
Trắc Nghiệm C++ - Bài 03
Trắc Nghiệm Ngôn Ngữ Lập Trình C ( English ) - Bài 15
Trắc Nghiệm Ngôn Ngữ Lập Trình C ( English ) - Bài 73
Trắc Nghiệm Ngôn Ngữ Lập Trình C ( English ) - Bài 40
Trắc Nghiệm Visual Basic - Bài 07
Trắc Nghiệm Java - Bài 45
Phát triển hệ thống: TRƯƠNG HỮU ĐỨC - Phiên bản 3.0 - © Copyright 2013 - 2024 - VNEDU.ORG

free counters