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 47
Ngày làm bài: Hôm nay lúc 02:23:44 (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 (sample.c) given below if it is executed from the command line (turbo c under DOS)?
cmd> sample Good Morning
/* sample.c */
#include<stdio.h>

int main(int argc, char *argv[])
{
    printf("%d %s", argc, argv[1]);
    return 0;
}

  A - 
3 Good
  B - 
2 Good
  C - 
Good Morning
  D - 
3 Morning
2-
What will be the output of the program
#include<stdio.h>
void fun(int);

int main(int argc)
{
    printf("%d\n", argc);
    fun(argc);
    return 0;
}
void fun(int i)
{
    if(i!=4)
        main(++i);
}

  A - 
1 2 3
  B - 
1 2 3 4
  C - 
2 3 4
  D - 
1
3-
What will be the output of the program (sample.c) given below if it is executed from the command line?
cmd> sample "*.c"
/* sample.c */
#include<stdio.h>

int main(int argc, int *argv)
{
    int i;
    for(i=1; i<argc; i++)
        printf("%s\n", argv[i]);
    return 0;
}

  A - 
*.c
  B - 
"*.c"
  C - 
sample *.c
  D - 
List of all files and folders in the current directory
4-
What will be the output of the program if it is executed like below?
cmd> sample
/* sample.c */
#include<stdio.h>

int main(int argc, char **argv)
{
    printf("%s\n", argv[argc-1]);
    return 0;
}

  A - 
0
  B - 
sample
  C - 
samp
  D - 
No output
5-
What will be the output of the program (sample.c) given below if it is executed from the command line?
cmd> sample friday tuesday sunday
/* sample.c */
#include<stdio.h>

int main(int argc, char *argv[])
{
    printf("%c", **++argv);
    return 0;
}

  A - 
s
  B - 
f
  C - 
sample
  D - 
friday
6-
What will be the output of the program (myprog.c) given below if it is executed from the command line?
cmd> myprog friday tuesday sunday
/* myprog.c */
#include<stdio.h>

int main(int argc, char *argv[])
{
    printf("%c", *++argv[1]);
    return 0;
}

  A - 
r
  B - 
f
  C - 
m
  D - 
y
7-
What will be the output of the program (sample.c) given below if it is executed from the command line?
cmd> sample one two three
/* sample.c */
#include<stdio.h>

int main(int argc, char *argv[])
{
    int i=0;
    i+=strlen(argv[1]);
    while(i>0)
    {
        printf("%c", argv[1][--i]);
    }
    return 0;
}

  A - 
three two one
  B - 
owt
  C - 
eno
  D - 
eerht
8-
What will be the output of the program in Turbo C?
#include<stdio.h>

int main(int argc, char *argv, char *env[])
{
    int i;
    for(i=1; i<argc; i++)
        printf("%s\n", env[i]);
    return 0;
}

  A - 
List of all environment variables
  B - 
List of all command-line arguments
  C - 
count of command-line arguments
  D - 
Error: cannot have more than two arguments in main()
9-
What will be the output of the program (sample.c) given below if it is executed from the command line?
cmd> sample Jan Feb Mar
/* sample.c */
#include<stdio.h>
#include<dos.h>

int main(int arc, char *arv[])
{
    int i;
    for(i=1; i<_argc; i++)
        printf("%s ", _argv[i]);
    return 0;
}

  A - 
No output
  B - 
sample Jan Feb Mar
  C - 
Jan Feb Mar
  D - 
Error
10-
What will be the output of the program (sample.c) given below if it is executed from the command line?
cmd> sample monday tuesday wednesday thursday
/* sample.c */
#include<stdio.h>

int main(int argc, char *argv[])
{
    while(--argc>0)
        printf("%s", *++argv);
    return 0;
}

  A - 
sample monday tuesday wednesday thursday
  B - 
monday tuesday wednesday thursday
  C - 
monday tuesday thursday
  D - 
tuesday
 
[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 Ngôn Ngữ Lập Trình C ( English ) - Bài 24
Trắc Nghiệm Ngôn Ngữ Lập Trình C ( English ) - Bài 74
Trắc Nghiệm Visual Foxpro - Bài 08
Trắc Nghiệm Thiết Kế Web - Bài 07
Trắc Nghiệm Pascal - Bài 24
Trắc Nghiệm C# - Bài 42
Trắc Nghiệm C Sharp - Bài 20
Trắc nghiệm Ngôn Ngữ Lập Trình C++ - Bài 47
Trắc Nghiệm Ngôn Ngữ Lập Trình C ( English ) - Bài 02
Trắc Nghiệm ASP.NET (English) - Bài 31
Trắc nghiệm C++ - Bài 19
Trắc nghiệm Ngôn Ngữ Lập Trình C++ - Bài 15
Trắc Nghiệm C# - Bài 51
Trắc Nghiệm Thiết Kế Web - Bài 04
Trắc nghiệm XML - Bài 23
Trắc nghiệm Linux ( English ) - Bài 22
Trắc Nghiệm Ngôn Ngữ Lập Trình C ( English ) - Bài 77
Trắc nghiệm Ngôn Ngữ Lập Trình C++ - Bài 20
Trắc Nghiệm C Sharp - Bài 31
Trắc Nghiệm Ngôn Ngữ Lập Trình C ( English ) - Bài 31
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