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 49
Ngày làm bài:
Hôm nay lúc 14:59: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:
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-
Which of the following statement is correct about the program given below?
#include
class IndiaBix { int x; public: IndiaBix(short ss) { cout<< "Short" << endl; } IndiaBix(int xx) { cout<< "Int" << endl; } IndiaBix(char ch) { cout<< "Char" << endl; } ~IndiaBix() { cout<< "Final"; } }; int main() { IndiaBix *ptr = new IndiaBix('B'); return 0; }
A -
The program will print the output Short .
B -
The program will print the output Int .
C -
The program will print the output Char .
D -
The program will print the output Final .
2-
Which of the following statement is correct about the program given below?
#include
class IndiaBix { int x; public: IndiaBix(short ss) { cout<< "Short" << endl; } IndiaBix(int xx) { cout<< "Int" << endl; } IndiaBix(float ff) { cout<< "Float" << endl; } ~IndiaBix() { cout<< "Final"; } }; int main() { IndiaBix *ptr = new IndiaBix('B'); return 0; }
A -
The program will print the output Short .
B -
The program will print the output Int .
C -
The program will print the output Float .
D -
The program will print the output Final .
3-
What will be the output of the following program?
#include
class BixBase { public: BixBase() { cout<< "Base OK. "; } ~BixBase() { cout<< "Base DEL. "; } }; class BixDerived: public BixBase { public: BixDerived() { cout<< "Derived OK. "; } ~BixDerived() { cout<< "Derived DEL. "; } }; int main() { BixBase *basePtr = new BixDerived(); delete basePtr; return 0; }
A -
Base OK. Derived OK.
B -
Base OK. Derived OK. Base DEL.
C -
Base OK. Derived OK. Derived DEL.
D -
Base OK. Derived OK. Derived DEL. Base DEL.
4-
What will be the output of the following program?
#include
class BixBase { public: BixBase() { cout<< "Base OK. "; } virtual ~BixBase() { cout<< "Base DEL. "; } }; class BixDerived: public BixBase { public: BixDerived() { cout<< "Derived OK. "; } ~BixDerived() { cout<< "Derived DEL. "; } }; int main() { BixBase *basePtr = new BixDerived(); delete basePtr; return 0; }
A -
Base OK. Derived OK.
B -
Base OK. Derived OK. Base DEL.
C -
Base OK. Derived OK. Derived DEL.
D -
Base OK. Derived OK. Derived DEL. Base DEL.
5-
What will be the output of the following program?
#include
class BixBase { public: int x, y; BixBase(int xx = 0, int yy = 5) { x = ++xx; y = --yy; } void Display() { cout<< --y; } ~BixBase(){} }; class BixDerived : public BixBase { public: void Increment() { y++; } void Display() { cout<< --y; } }; int main() { BixDerived objBix; objBix.Increment(); objBix.Display(); return 0; }
A -
3
B -
4
C -
5
D -
Garbage-value
6-
What will be the out of the following program?
#include
class BixBase { protected: int x, y; public: BixBase(int xx = 0, int yy = 0) { x = xx; y = yy; } void Show() { cout<< x * this->y << endl; } }; class BixDerived { private: BixBase objBase; public: BixDerived(int xx, int yy) : objBase(xx, yy) { objBase.Show(); } ~BixDerived() { } }; int main() { BixDerived objDev(10, 20); return 0; }
A -
100
B -
200
C -
400
D -
The program will report compile time error.
7-
Which of the following statement is correct about the program given below?
#include
class IndiaBix { int x; public: IndiaBix() { x = 0; } IndiaBix(int xx) { x = xx; } IndiaBix(IndiaBix &objB) { x = objB.x; } void Display() { cout<< x << " "; } }; int main() { IndiaBix objA(25); IndiaBix objB(objA); IndiaBix objC = objA; objA.Display(); objB.Display(); objC.Display(); return 0; }
A -
The program will print the output 25 25 25 .
B -
The program will print the output 25 Garbage 25 .
C -
The program will print the output Garbage 25 25 .
D -
The program will report compile time error.
8-
Which of the following statement is correct about the program given below?
#include
class IndiaBix { int x, y; public: IndiaBix() { x = 0; y = 0; } IndiaBix(int xx, int yy) { x = xx; y = yy; } IndiaBix(IndiaBix *objB) { x = objB->x; y = objB->y; } void Display() { cout<< x << " " << y; } }; int main() { IndiaBix objBix( new IndiaBix(20, 40) ); objBix.Display(); return 0; }
A -
The program will print the output 0 0 .
B -
The program will print the output 20 40 .
C -
The program will print the output Garbage Garbage .
D -
The program will report compile time error.
9-
What will be the out of the following program?
#include
class BixBase { public: int x, y; public: BixBase(int xx = 0, int yy = 0) { x = xx; y = yy; } }; class BixDerived : public BixBase { private: BixBase objBase; public: BixDerived(int xx, int yy) : BixBase(xx), objBase(yy) { cout << this->x << " " << this->y << " " << objBase.x << " " << objBase.y << " "; } ~BixDerived() { } }; int main() { BixDerived objDev(11, 22); return 0; }
A -
11 0 0 22
B -
11 22 11 22
C -
11 0 22 0
D -
The program will report compile time error.
10-
What will be the out of the following program?
#include
class BixBase { public: int x, y; public: BixBase(int xx = 0, int yy = 0) { x = xx; y = yy; } }; class BixDerived : public BixBase { private: BixBase objBase; public: BixDerived(int xx, int yy) : BixBase(xx), objBase(yy) { cout << x << " " << this->x << " " << BixBase::x << " " << this->objBase.x ; } ~BixDerived() { } }; int main() { BixDerived objDev(11, 22); return 0; }
A -
11 11 0 22
B -
11 11 11 0
C -
11 11 11 22
D -
The program will report compile time 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
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 Ngôn Ngữ Lập Trình C ( English ) - Bài 03
Trắc Nghiệm Thiết Kế Web (English) - Bài 27
Trắc Nghiệm Thiết Kế Web - Bài 10
Trắc Nghiệm ASP.NET (English) - Bài 14
Trắc Nghiệm C++ - Bài 01
Trắc nghiệm Linux ( English ) - Bài 26
Trắc nghiệm Ngôn Ngữ Lập Trình C++ - Bài 48
Trắc Nghiệm ASP.NET - Bài 06
Trắc nghiệm Ngôn Ngữ Lập Trình C++ - Bài 15
Trắc nghiệm Linux - Bài 52
Trắc Nghiệm Pascal - Bài 17
Trắc Nghiệm Java - Bài 29
Trắc Nghiệm Ngôn Ngữ Lập Trình C ( English ) - Bài 39
Trắc Nghiệm Java - Bài 08
Trắc Nghiệm Ngôn Ngữ Lập Trình C ( English ) - Bài 55
Trắc nghiệm XML - Bài 25
Trắc Nghiệm Thiết Kế Web Và Flash - Bài 26
Trắc Nghiệm Visual Foxpro - Bài 07
Trắc Nghiệm Thiết Kế Web (English) - Bài 06
Trắc Nghiệm Ngôn Ngữ Lập Trình C ( English ) - Bài 07
Phát triển hệ thống: TRƯƠNG HỮU ĐỨC - Phiên bản 3.0 - © Copyright 2013 - 2024 - VNEDU.ORG