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 58
Ngày làm bài:
Hôm nay lúc 07:12:55 (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
#include
class BixString { char x[50]; char y[50]; char z[50]; public: BixString() { } BixString(char* xx) { strcpy(x, xx); strcpy(y, xx); } BixString(char *xx, char *yy = " C++", char *zz = " Programming!") { strcpy(z, xx); strcat(z, yy); strcat(z, zz); } void Display(void) { cout<< z << endl; } }; int main() { BixString objStr("Learn", " Java"); objStr.Display(); return 0; }
A -
Java Programming!
B -
C++ Programming!
C -
Learn C++ Programming!
D -
Learn Java Programming!
2-
What will be the output of the following program?
#include
class BaseCounter { protected: long int count; public: void CountIt(int x, int y = 10, int z = 20) { count = 0; cout<< x << " " << y << " " << z << endl; } BaseCounter() { count = 0; } BaseCounter(int x) { count = x ; } }; class DerivedCounter: public BaseCounter { public: DerivedCounter() { } DerivedCounter(int x): BaseCounter(x) { } }; int main() { DerivedCounter objDC(30); objDC.CountIt(40, 50); return 0; }
A -
30 10 20
B -
Garbage 10 20
C -
40 50 20
D -
20 40 50
3-
What will be the output of the following program?
#include
class Number { int Num; public: Number(int x = 0) { Num = x; } void Display(void) { cout<< Num; } void Modify(); }; void Number::Modify() { int Dec; Dec = Num % 13; Num = Num / 13; if(Num > 0 ) Modify() ; if(Dec == 10) cout<< "A" ; else if(Dec == 11) cout<< "B" ; else if(Dec == 12) cout<< "C" ; else if(Dec == 13) cout<< "D" ; else cout<< Dec ; } int main() { Number objNum(130); objNum.Modify(); return 0; }
A -
130
B -
A0
C -
B0
D -
90
4-
What will be the output of the following program?
#include
class Base { int x, y; public: Base() { x = y = 0; } Base(int xx) { x = xx; } Base(int p, int q = 10) { x = p + q; y = q; } void Display(void) { cout<< x << " " << y << endl; } }objDefault(1, 1); class Derived: public Base { Base obj; public: Derived(int xx, int yy): Base(xx, xx + 1) { } Derived(Base objB = objDefault) { } }; int main() { Derived objD(5, 3); Derived *ptrD = new Derived(objD); ptrD->Display(); delete ptrD; return 0; }
A -
8 3
B -
11 6
C -
11 10
D -
The program will not compile successfully.
5-
What is correct about the following program?
#include
class Base { int x, y, z; public: Base() { x = y = z = 0; } Base(int xx, int yy = 'A', int zz = 'B') { x = xx; y = x + yy; z = x + y; } void Display(void) { cout<< x << " " << y << " " << z << endl; } }; class Derived : public Base { int x, y; public: Derived(int xx = 65, int yy = 66) : Base(xx, yy) { y = xx; x = yy; } void Display(void) { cout<< x << " " << y << " "; Display(); } }; int main() { Derived objD; objD.Display(); return 0; }
A -
The program will run successfully giving the output 66 65.
B -
The program will run successfully giving the output 66 65 65 131 196.
C -
The program will run successfully giving the output 65 66.
D -
The program will produce the output 66 65 infinite numb
6-
Which of the following statement is correct about the program given below?
#include
static int Result; class India { public: void Change(int x = 10, int y = 20, int z = 30) { cout<< x + y + z; } void Display(int x = 40, float y = 50.00) { Result = x % x; cout<< Result; } }; class Bix { int x, y; public: void Change(int x, int y = 50) { cout<< x + y; } }; class IndiaBix: public India, public Bix { public: void Display(int x = 10, int xx = 100, int xxx = 1000) { Result = x + xx % x * x; cout<< Result ; } }; int main() { IndiaBix objBix; objBix.India::Display(10, 20.00); return 0; }
A -
The program will print the output 0.
B -
The program will print the output 10.
C -
The program will print the output 30.
D -
The program will print the output 40.
7-
Which of the following statement is correct about the program given below?
#include
class IndiaBix { int x; float y; public: void BixFunction(int = 0, float = 0.00f, char = 'A'); void BixFunction(float, int = 10.00, char = 'Z'); void BixFunction(char, char, char); }; int main() { IndiaBix objBix; objBix.BixFunction(10 * 1.0, int(56.0)); return 0; } void IndiaBix::BixFunction(int xx, float yy, char zz) { x = xx + int(yy); cout<< "x = " << x << endl; } void IndiaBix::BixFunction(float xx, int yy, char zz) { x = zz + zz; y = xx + yy; cout<< " x = " << x << endl; } void IndiaBix::BixFunction(char xx, char yy, char zz) { x = xx + yy + zz; y = float(xx * 2); cout<< " x = " << x << endl; }
A -
The program will print the output x = 65.
B -
The program will print the output x = 66.
C -
The program will print the output x = 130.
D -
The program will print the output x = 180.
8-
Which of the following statement is correct about the program given below?
#include
static double gDouble; static float gFloat; static double gChar; static double gSum = 0; class BaseOne { public: void Display(double x = 0.0, float y = 0.0, char z = 'A') { gDouble = x; gFloat = y; gChar = int(z); gSum = gDouble + gFloat + gChar; cout << gSum; } }; class BaseTwo { public: void Display(int x = 1, float y = 0.0, char z = 'A') { gDouble = x; gFloat = y; gChar = int(z); gSum = gDouble + gFloat + gChar; cout << gSum; } }; class Derived : public BaseOne, BaseTwo { void Show() { cout << gSum; } }; int main() { Derived objDev; objDev.BaseTwo::Display(10, 20, 'Z'); return 0; }
A -
The program will print the output 0.
B -
The program will print the output 120.
C -
The program will report run-time error.
D -
The program will report compile-time error.
9-
What will be the output of the following program?
#include
class Base { public: int S, A, M; Base(int x, int y) { S = y - y; A = x + x; M = x * x; } Base(int, int y = 'A', int z = 'B') { S = y; A = y + 1 - 1; M = z - 1; } void Display(void) { cout<< S << " " << A << " " << M << endl; } }; class Derived : public Base { int x, y, z; public: Derived(int xx = 65, int yy = 66, int zz = 67): Base(x) { x = xx; y = yy; z = zz; } void Display(int n) { if(n) Base::Display(); else cout<< x << " " << y << " " << z << endl; } }; int main() { Derived objDev; objDev.Display(-1); return 0; }
A -
65 65 65
B -
65 66 67
C -
A A A
D -
A B C
10-
What will be the output of the following program?
#include
class Base { public: char S, A, M; Base(char x, char y) { S = y - y; A = x + x; M = x * x; } Base(char, char y = 'A', char z = 'B') { S = y; A = y + 1 - 1; M = z - 1; } void Display(void) { cout<< S << " " << A << " " << M << endl; } }; class Derived : public Base { char x, y, z; public: Derived(char xx = 65, char yy = 66, char zz = 65): Base(x) { x = xx; y = yy; z = zz; } void Display(int n) { if(n) Base::Display(); else cout<< x << " " << y << " " << z << endl; } }; int main() { Derived objDev; objDev.Display(0-1); return 0; }
A -
A A A
B -
A B A
C -
A B C
D -
Garbage Garbage Garbage
[
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 Linux - Bài 37
Trắc Nghiệm Visual Basic - Bài 34
Trắc nghiệm Linux ( English ) - Bài 29
Trắc Nghiệm ASP.NET (English) - Bài 09
Trắc Nghiệm Ngôn Ngữ Lập Trình C - Bài 28
Trắc Nghiệm Visual Basic - Bài 11
10 Câu Hỏi Trắc nghiệm Về ASP.NET - Phần 02
Trắc Nghiệm Java - Bài 30
Trắc nghiệm XML - Bài 17
Trắc Nghiệm Ngôn Ngữ Lập Trình C ( English ) - Bài 35
Trắc Nghiệm Thiết Kế Web (English) - Bài 34
Trắc Nghiệm ASP.NET - Bài 11
Trắc Nghiệm C# - Bài 34
Trắc nghiệm Ngôn Ngữ Lập Trình C++ - Bài 15
Trắc Nghiệm Thiết Kế Web - Bài 03
Trắc Nghiệm Thiết Kế Web (English) - Bài 15
Trắc nghiệm Linux - Bài 57
Trắc Nghiệm Visual Foxpro - Bài 02
Trắc Nghiệm Ngôn Ngữ Lập Trình C ( English ) - Bài 69
Trắc nghiệm Ngôn Ngữ Lập Trình C++ - Bài 33
Phát triển hệ thống: TRƯƠNG HỮU ĐỨC - Phiên bản 3.0 - © Copyright 2013 - 2024 - VNEDU.ORG