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 18
Ngày làm bài: Hôm nay lúc 22:10:35 (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 fun(int(*)());

int main()
{
    fun(main);
    printf("Hi\n");
    return 0;
}
int fun(int (*p)())
{
    printf("Hello ");
    return 0;
}

  A - 
Infinite loop
  B - 
Hi
  C - 
Hello Hi
  D - 
Error
2-
What will be the output of the program?
#include<stdio.h>

int fun(int i)
{
    i++;
    return i;
}

int main()
{
    int fun(int);
    int i=3;
    fun(i=fun(fun(i)));
    printf("%d\n", i);
    return 0;
}

  A - 
5
  B - 
4
  C - 
Error
  D - 
Garbage value
3-
What will be the output of the program?
#include<stdio.h>
int fun(int);
int main()
{
    float k=3;
    fun(k=fun(fun(k)));
    printf("%f\n", k);
    return 0;
}
int fun(int i)
{
    i++;
    return i;
}

  A - 
5.000000
  B - 
3.000000
  C - 
Garbage value
  D - 
4.000000
4-
What will be the output of the program?
#include<stdio.h>
#include<stdlib.h>

int main()
{
    int i=0;
    i++;
    if(i<=5)
    {
        printf("IndiaBIX");
        exit(1);
        main();
    }
    return 0;
}

  A - 
Prints "IndiaBIX" 5 times
  B - 
Function main() doesn't calls itself
  C - 
Infinite loop
  D - 
Prints "IndiaBIx"
5-
Point out the error in the program

f(int a, int b)
{
    int a;
    a = 20;
    return a;
}

  A - 
Missing parenthesis in return statement
  B - 
The function should be defined as int f(int a, int b)
  C - 
Redeclaration of a
  D - 
None of above
6-
Point out the error in the program
#include<stdio.h>
int f(int a)
{
  a > 20? return(10): return(20);
}
int main()
{
    int f(int);
    int b;
    b = f(20);
    printf("%d\n", b);
    return 0;
}

  A - 
Error: Prototype declaration
  B - 
No error
  C - 
Error: return statement cannot be used with conditional operators
  D - 
None of above
7-
Point out the error in the program
#include<stdio.h>

int main()
{
    int a=10;
    void f();
    a = f();
    printf("%d\n", a);
    return 0;
}
void f()
{
    printf("Hi");
}

  A - 
Error: Not allowed assignment
  B - 
Error: Doesn't print anything
  C - 
No error
  D - 
None of above
8-
Which of the following statements are correct about the program?
#include<stdio.h>

int main()
{
    printf("%p\n", main());
    return 0;
}

  A - 
It prints garbage values infinitely
  B - 
Runs infinitely without printing anything
  C - 
Error: main() cannot be called inside printf()
  D - 
No Error and print nothing
9-
There is a error in the below program. Which statement will you add to remove it?
#include<stdio.h>

int main()
{
    int a;
    a = f(10, 3.14);
    printf("%d\n", a);
    return 0;
}
float f(int aa, float bb)
{
    return ((float)aa + bb);
}

  A - 
Add prototype: float f(aa, bb)
  B - 
Add prototype: float f(int, float)
  C - 
Add prototype: float f(float, int)
  D - 
Add prototype: float f(bb, aa)
10-
Which of the following statements are correct about the function?
long fun(int num)
{
    int i;
    long f=1;
    for(i=1; i<=num; i++)
        f = f * i;
    return f;
}

  A - 
The function calculates the value of 1 raised to power num.
  B - 
The function calculates the square root of an integer
  C - 
The function calculates the factorial value of an integer
  D - 
None of above
 
[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 05
Trắc Nghiệm Java - Bài 26
Trắc Nghiệm Thiết Kế Web - Bài 13
Trắc Nghiệm Pascal - Bài 24
Trắc Nghiệm ASP.NET (English) - Bài 19
Trắc nghiệm C++ - Bài 16
Trắc Nghiệm C++ - Bài 03
Trắc Nghiệm Thiết Kế Web Và Flash - Bài 27
Trắc Nghiệm Visual Basic - Bài 29
Trắc Nghiệm Thiết Kế Web (English) - Bài 48
Trắc nghiệm C++ - Bài 18
Trắc Nghiệm C Sharp - Bài 20
Trắc Nghiệm Ngôn Ngữ Lập Trình C - Bài 13
Trắc Nghiệm C# - Bài 44
Trắc nghiệm XML - Bài 02
Trắc Nghiệm Java - Bài 28
Trắc Nghiệm Pascal - Bài 10
Trắc Nghiệm Java - Bài 22
Trắc Nghiệm Thiết Kế Web - Bài 12
Trắc nghiệm XML - Bài 28
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