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 28
Ngày làm bài: Hôm nay lúc 02:22:14 (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-
If the size of integer is 4bytes, What will be the output of the program?
#include<stdio.h>

int main()
{
    int arr[] = {12, 13, 14, 15, 16};
    printf("%d, %d, %d\n", sizeof(arr), sizeof(*arr), sizeof(arr[0]));
    return 0;
}

  A - 
10, 2, 4
  B - 
20, 4, 4
  C - 
16, 2, 2
  D - 
20, 2, 2
2-
Point out the compile time error in the program given below.
#include<stdio.h>

int main()
{
    int *x;
    *x=100;
    return 0;
}

  A - 
Error: invalid assignment for x
  B - 
Error: suspicious pointer conversion
  C - 
No error
  D - 
None of above
3-
Point out the error in the program
#include<stdio.h>

int main()
{
    int a[] = {10, 20, 30, 40, 50};
    int j;
    for(j=0; j<5; j++)
    {
        printf("%d\n", a);
        a++;
    }
    return 0;
}

  A - 
Error: Declaration syntax
  B - 
Error: Expression syntax
  C - 
Error: LValue required
  D - 
Error: Rvalue required
4-
Which of the following statements correctly declare a function that receives a pointer to pointer to a pointer to a float and returns a pointer to a pointer to a pointer to a pointer to a float?
  A - 
float **fun(float***);
  B - 
float *fun(float**);
  C - 
float fun(float***);
  D - 
float ****fun(float***);
5-
Which of the statements is correct about the program?
#include<stdio.h>

int main()
{
    int i=10;
    int *j=&i;
    return 0;
}

  A - 
j and i are pointers to an int
  B - 
i is a pointer to an int and stores address of j
  C - 
j is a pointer to an int and stores address of i
  D - 
j is a pointer to a pointer to an int and stores address of i
6-
Which of the statements is correct about the program?
#include<stdio.h>

int main()
{
    float a=3.14;
    char *j;
    j = (char*)&a;
    printf("%d\n", *j);
    return 0;
}

  A - 
It prints ASCII value of the binary number present in the first byte of a float variable a.
  B - 
It prints character equivalent of the binary number present in the first byte of a float variable a.
  C - 
It will print 3
  D - 
It will print a garbage value
7-
In the following program add a statement in the function fun() such that address of a gets stored in j?
#include<stdio.h>
int main()
{
    int *j;
    void fun(int**);
    fun(&j);
    return 0;
}
void fun(int **k)
{
    int a=10;
    /* Add a statement here */
}

  A - 
**k=a;
  B - 
k=&a;
  C - 
*k=&a
  D - 
&k=*a
8-
Which of the following statements correct about k used in the below statement?
char ****k;
  A - 
k is a pointer to a pointer to a pointer to a char
  B - 
k is a pointer to a pointer to a pointer to a pointer to a char
  C - 
k is a pointer to a char pointer
  D - 
k is a pointer to a pointer to a char
9-
Which of the statements is correct about the program?
#include<stdio.h>

int main()
{
    int arr[3][3] = {1, 2, 3, 4};
    printf("%d\n", *(*(*(arr))));
    return 0;
}

  A - 
Output: Garbage value
  B - 
Output: 1
  C - 
Output: 3
  D - 
Error: Invalid indirection
10-
Which statement will you add to the following program to ensure that the program outputs "IndiaBIX" on execution?
#include<stdio.h>

int main()
{
    char s[] = "IndiaBIX";
    char t[25];
    char *ps, *pt;
    ps = s;
    pt = t;
    while(*ps)
        *pt++ = *ps++;

    /* Add a statement here */
    printf("%s\n", t);
    return 0;
}

  A - 
*pt='';
  B - 
pt='\0';
  C - 
pt='\n';
  D - 
*pt='\0';
 
[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 XML - Bài 15
Trắc Nghiệm Java - Bài 03
Trắc Nghiệm C# - Bài 50
Trắc Nghiệm Ngôn Ngữ Lập Trình C ( English ) - Bài 45
Trắc Nghiệm Thiết Kế Web (English) - Bài 41
Trắc Nghiệm ASP.NET (English) - Bài 03
Trắc Nghiệm C# - Bài 32
Trắc Nghiệm Ngôn Ngữ Lập Trình C ( English ) - Bài 49
Trắc nghiệm Ngôn Ngữ Lập Trình C++ - Bài 32
Trắc Nghiệm Visual Foxpro - Bài 06
Trắc Nghiệm Visual Basic - Bài 34
Trắc Nghiệm Pascal - Bài 01
Trắc Nghiệm ASP.NET - Bài 09
Trắc Nghiệm Ngôn Ngữ Lập Trình C ( English ) - Bài 24
Trắc Nghiệm C Sharp - Bài 06
Trắc Nghiệm ASP.NET (English) - Bài 19
Trắc Nghiệm C Sharp - Bài 08
Trắc Nghiệm Thiết Kế Web Và Flash - Bài 31
Trắc nghiệm XML - Bài 09
Trắc Nghiệm Ngôn Ngữ Lập Trình C ( English ) - Bài 35
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