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 85
Ngày làm bài: Hôm nay lúc 19:55:05 (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-
Point out the error in the program?
struct emp
{
    int ecode;
    struct emp e;
};

  A - 
Error: in structure declaration
  B - 
Linker Error
  C - 
No Error
  D - 
None of above
2-
What will be the output of the program ?
#include<stdio.h>

int main()
{
    FILE *ptr;
    char i;
    ptr = fopen("myfile.c", "r");
    while((i=fgetc(ptr))!=NULL)
        printf("%c", i);
    return 0;
}

  A - 
Print the contents of file "myfile.c"
  B - 
Print the contents of file "myfile.c" upto NULL character
  C - 
Infinite loop
  D - 
Error in program
3-
While calling the fprintf() function in the format string conversion specifier %s can be used to write a character string in capital letters.
  A - 
True
  B - 
False
4-
The maximum combined length of the command-line arguments including the spaces between adjacent arguments is
  A - 
128 characters
  B - 
256 characters
  C - 
67 characters
  D - 
It may vary from one operating system to another
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-
What will be the output of the program?
#include<stdio.h>

int main()
{
    const c = -11;
    const int d = 34;
    printf("%d, %d\n", c, d);
    return 0;
}

  A - 
Error
  B - 
-11, 34
  C - 
11, 34
  D - 
None of these
7-
Point out the correct statement will let you access the elements of the array using 'p' in the following program?
#include
#include

int main()
{
    int i, j;
    int(*p)[3];
    p = (int(*)[3])malloc(3*sizeof(*p));
    return 0;
}

  A - 
for(i=0; i<3; i++)
{
    for(j=0; j<3; j++)
        printf("%d", p[i+j]);
}
  B - 
for(i=0; i<3; i++)
    printf("%d", p[i]);
  C - 
for(i=0; i<3; i++)
{
    for(j=0; j<3; j++)
        printf("%d", p[i][j]);
}
  D - 
for(j=0; j<3; j++)
    printf("%d", p[i][j]);
8-
What do the following declaration signify?
char *arr[10];

  A - 
arr is a array of 10 character pointers.
  B - 
arr is a array of function pointer.
  C - 
arr is a array of characters.
  D - 
arr is a pointer to array of characters.
9-
Point out the error in the following program.
#include<stdio.h>
#include<string.h>

int main()
{
    char str1[] = "Learn through IndiaBIX\0.com",  str2[120];
    char *p;
    p = (char*) memccpy(str2, str1, 'i', strlen(str1));
    *p = '\0';
    printf("%s", str2);
    return 0;
}

  A - 
Error: in memccpy statement
  B - 
Error: invalid pointer conversion
  C - 
Error: invalid variable declaration
  D - 
No error and prints "Learn through Indi"
10-
Point out the error in the following program.
#include<stdio.h>

int main()
{
    char str[] = "IndiaBIX";
    printf("%.#s %2s", str, str);
    return 0;
}

  A - 
Error: in Array declaration
  B - 
Error: printf statement
  C - 
Error: unspecified character in printf
  D - 
No error
 
[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 C# - Bài 38
Trắc Nghiệm ASP.NET (English) - Bài 14
Trắc Nghiệm Thiết Kế Web - Bài 12
Trắc Nghiệm Java - Bài 12
Trắc Nghiệm Thiết Kế Web (English) - Bài 12
Trắc Nghiệm Java - Bài 03
Trắc nghiệm Linux - Bài 45
Trắc Nghiệm ASP.NET (English) - Bài 06
Trắc nghiệm Ngôn Ngữ Lập Trình C++ - Bài 47
Trắc Nghiệm Thiết Kế Web Và Flash - Bài 04
Trắc nghiệm Linux ( English ) - Bài 32
Trắc nghiệm Ngôn Ngữ Lập Trình C++ - Bài 18
Trắc Nghiệm Visual Basic - Bài 01
Trắc Nghiệm Thiết Kế Web (English) - Bài 02
Trắc Nghiệm C Sharp - Bài 23
Trắc Nghiệm C# - Bài 32
Trắc nghiệm Ngôn Ngữ Lập Trình C++ - Bài 08
Trắc Nghiệm Pascal - Bài 01
Trắc Nghiệm Java - Bài 51
Trắc Nghiệm Java - Bài 38
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