WEBSITE bất vụ lợi - Vì lợi ích cộng đồng - Non-Profit Website for the benefit of Community Learning
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
Tin Học
Luyện thi Đại học
Lớp 12
Lớp 11
Lớp 10
Lớp 9
Lớp 8
Lớp 7
Lớp 6
Tiểu học
Tiếng Anh
Bài học lý thuyết
Thi bằng
Kiến thức tổng quát
Phương pháp học
---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++ - Bài 57
Ngày làm bài:
Hôm nay lúc 10:41:04 (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:
12 pt
13 pt
14 pt
15 pt
16 pt
17 pt
18 pt
19 pt
20 pt
Cỡ chữ đáp án:
12 pt
13 pt
14 pt
15 pt
16 pt
17 pt
18 pt
19 pt
20 pt
1-
What will be the output of the following program?
#include
class IndiaBix { public: int x, y; IndiaBix(int xx = 10, int yy = 20) { x = xx; y = yy; } void Exchange(int *, int *); }; int main() { IndiaBix objA(30, 40); IndiaBix objB(50); objA.Exchange(&objA.x, &objB.y); cout<< objA.x << " " << objB.y << endl; return 0; } void IndiaBix::Exchange(int *x, int *y) { int t; t = *x; *x = *y; *y = t ; }
A -
20 10
B -
30 20
C -
20 30
D -
30 40
2-
Which of the following statement is correct about the program given below?
#include
class BixArray { int Matrix[3][3]; public: BixArray() { for(int i = 0; i<3; i++) for(int j = 0; j < 3; j++) Matrix[j][i] = i + j; } void Display(void) { for(int i = 0; i < 3; i++) for(int j = 0; j < 3; j++) cout<< Matrix[j][i] << " "; } }; int main() { BixArray objBix; objBix.Display(); return 0; }
A -
The program will display the output 4 3 2 3 2 1 2 1 0.
B -
The program will display the output 0 1 2 1 2 3 2 3 4.
C -
The program will display the output 9 garbage values.
D -
The program will report error on compilation.
3-
What will be the output of the following program?
#include
class IndiaBix { int x, y, z; public: void Apply(int xx = 12, int yy = 21, int zz = 9) { x = xx; y = yy += 10; z = x -= 2; } void Display(void) { cout<< x << " " << y << endl; } void SetValue(int xx, int yy) { Apply(xx, 0, yy); } }; int main() { IndiaBix *pBix= new IndiaBix; (*pBix).SetValue(12, 20); pBix->Display(); delete pBix; return 0; }
A -
10 10
B -
12 10
C -
12 21
D -
The program will report compilation error.
4-
What will be the output of the following program?
#include
#include
class IndiaBix { char txtMsg[50]; public: IndiaBix(char *str = NULL) { if(str != NULL) strcpy(txtMsg, str); } int BixFunction(char ch); }; int IndiaBix::BixFunction(char ch) { static int i = 0; if(txtMsg[i++] == ch) return strlen((txtMsg + i)) - i; else return BixFunction(ch); } int main() { IndiaBix objBix("Welcome to IndiaBix.com!"); cout<< objBix.BixFunction('t'); return 0; }
A -
6
B -
8
C -
9
D -
15
5-
Which of the following statement is correct about the program given below?
#include
#include
#include
class BixString { char txtName[20]; public: BixString(char *txtTemp = NULL) { if(txtTemp != NULL) strcpy(txtName, txtTemp); } void Display(void) { cout<
A -
Above program will display IndiaBIX 8.
B -
Above program will display IndiaBIX 9.
C -
Above program will display size of integer.
D -
Above program will display IndiaBIX and size of integer.
6-
Which of the following statement is correct about the program given below?
#include
class IndiaBix { int x, y, z; public: IndiaBix(int x = 100, int y = 30, int z = 0) { this->x = x; this->y = y; this->z = z; Display(); } void Display() { cout<< x << " " << y << " " << z; } }; int main() { int a = 0, b = 1, c = 2; int &x = ++a; int &y = --b; int z = c + b - -c; IndiaBix objBix(x, y, z); return 0; }
A -
The program will print the output 1 0 3.
B -
The program will print the output 1 0 4.
C -
The program will print the output 1 1 3.
D -
The program will print the output 1 1 4.
7-
Which of the following statement is correct about the program given below?
#include
class BixArray { int array[3][3]; public: BixArray(int arr[3][3] = NULL) { if(arr != NULL) for(int i = 0; i < 3; i++) for(int j = 0; j < 3; j++) array[i][j] = i+j; } void Display(void) { for(int i = 0; i < 3; i++) for(int j = 0; j < 3; j++) cout<< array[i][j] << " "; } }; int main() { BixArray objBA; objBA.Display(); return 0; }
A -
The program will display NULL 9 times.
B -
The program will report error on compilation.
C -
The program will display 9 garbage values.
D -
The program will display 0 1 2 1 2 3 2 3 4.
8-
What will be the output of the following program?
#include
struct IndiaBix { int arr[5]; public: void BixFunction(void); void Display(void); }; void IndiaBix::Display(void) { for(int i = 0; i < 5; i++) cout<< arr[i] << " " ; } void IndiaBix::BixFunction(void) { static int i = 0, j = 4; int tmp = arr[i]; arr[i] = arr[j]; arr[j] = tmp ; i++; j--; if(j != i) BixFunction(); } int main() { IndiaBix objBix = {{ 5, 6, 3, 9, 0 }}; objBix.BixFunction(); objBix.Display(); return 0; }
A -
0 9 3 6 5
B -
9 3 6 5 0
C -
5 6 3 9 0
D -
5 9 3 6 0
9-
Which of the following statement is correct about the program given below?
#include
class IndiaBix { int x; float y; public: IndiaBix(int x) { x = x; } IndiaBix(int p = 0, int q = 10) { x = p += 2; y = q * 1.0f; } void SetValue(int &y, float z) { x = y; y = (int)z; } void Display(void) { cout<< x; } }; int main() { int val = 12; IndiaBix objBix(val); IndiaBix objTmp(); objBix.SetValue(val, 3.14f); objBix.Display(); return 0; }
A -
The program will print the output 2.
B -
The program will print the output 12.
C -
The program will report run time error.
D -
The program will not compile successfully.
10-
What will be the output of the following program?
#include
struct BixArray { int arr[5]; public: void BixFunction(); void Display(); }; void BixArray::BixFunction() { static int i = 0, j = 4; i++; j--; if(j > 0) BixFunction(); int tmp = arr[i]; arr[i] = arr[j]; arr[j] = tmp; i--; j++; } void BixArray::Display() { for(int i = 0; i < 5; i++) cout<< arr[i] << " "; } int main() { BixArray objArr = {{5, 6, 3, 9, 0}}; objArr.BixFunction(); objArr.Display(); return 0; }
A -
0 9 3 6 5
B -
0 5 6 3 9
C -
0 6 3 9 5
D -
None of these
[
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
Phong Bảo 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 ASP.NET (English) - Bài 30
Trắc Nghiệm Thiết Kế Web (English) - Bài 37
Trắc Nghiệm Java - Bài 18
Trắc Nghiệm Ngôn Ngữ Lập Trình C - Bài 05
Trắc Nghiệm ASP.NET - Bài 22
Trắc nghiệm Ngôn Ngữ Lập Trình C++ - Bài 26
Trắc Nghiệm C# - Bài 32
Trắc Nghiệm Ngôn Ngữ Lập Trình C ( English ) - Bài 54
Trắc Nghiệm Ngôn Ngữ Lập Trình C - Bài 27
Trắc Nghiệm Thiết Kế Web Và Flash - Bài 22
Trắc Nghiệm C++ - Bài 05
Trắc Nghiệm Pascal - Bài 15
Trắc Nghiệm ASP.NET (English) - Bài 17
Trắc Nghiệm Ngôn Ngữ Lập Trình C - Bài 23
Trắc nghiệm Linux - Bài 54
Trắc Nghiệm C++ - Bài 06
Trắc Nghiệm Ngôn Ngữ Lập Trình C ( English ) - Bài 25
Trắc Nghiệm ASP.NET (English) - Bài 08
Trắc Nghiệm Pascal - Bài 02
Trắc Nghiệm Ngôn Ngữ Lập Trình C ( English ) - Bài 55
Phát triển hệ thống: TRƯƠNG HỮU ĐỨC - Phiên bản 3.0 - © Copyright 2013 - 2024 - VNEDU.ORG