Mcq Careers
Current Affairs
Pakistan Current Affairs
World Current Affairs
Computer Competency
English
Computer Science
CCNA
C Plus Plus Mcqs
Q.1: The value of "(sizeof(short) == sizeof(int) && sizeof(int) == sizeof(long))" isO
A.
implementation defined
B.
compiler error
C.
false
D.
true
Q.2: class A { int x; protected: int y; public: int z; }; class B: public virtual A { }; What is the privacy level of B::x?y
A.
private
B.
B does not inherit access to x from A.&
C.
public
D.
protected
Q.3: bool is_even(int i) { return i % 2 == 0; } int v[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; std::partition(v, v + 10, is_even); What is the content of array v?
A.
0,1,2,3,4,5,6,7,8,9
B.
9,8,7,6,5,4,3,2,1
C.
0,8,2,6,4,5,3,7,1,9
D.
9,1,7,3,5,4,6,2,8,0
Q.4: Which function always returns an rvalue reference from "x", which can be used to indicate the object is going to be destroyed soon?
A.
std::xvalue(x)
B.
std::move(x)
C.
std::shift(x)
D.
std::destroy(x)
Q.5: std::vector<int> v(10); std::iota(v.begin(), v.end(), 10); What is the content of vector v?b
A.
1,2,3,4,5,6,7,8,9,10
B.
10,11,12,13,14,15,16,17,18,19,20
C.
1,2,3,4,5,6,7,8,9
D.
10,11,12,13,14,15,16,17,18,19
Q.6: What is the output of the following program? int a, b = 3; const int& ar[]= {a, b}; ar[0] = 2; std::cout << ar[0];s
A.
3
B.
no output; program is ill-formed
C.
0
D.
2
Q.7: What is value of x, if sizeof(int) == 4? unsigned int a = 0x98765432; unsigned int x = a >> 33;`
A.
0x98765432
B.
1
C.
This is undefined behavior
D.
0
Q.8: class foo { foo(){}; }; class boo : public foo { boo() : foo() {}; }; which standard allows compilation of this code.w
A.
none, the code wont compile
B.
c++11
C.
none, the code wont compile
D.
c++98
Q.9: Is it possible to create class instance placed at a particular location in memory?R
A.
Only by dirty hack with reinterpret_cast.)
B.
No. Only allocation on stack or in dynamic memory is allowed.=
C.
No Option
D.
No Option
Q.10: int a[] {1, 2, 3}; a[[] { return 2; }()] += 2; What is the value of a[2]?J
A.
3
B.
Undefined behavior
C.
Compile error: malformed attribute.#
D.
Compile error: malformed attribute.#
Back
Go
Next
Related Mcqs
Android Programming Mcqs
Anti spam and antivirus Mcqs
Apache Mcqs
Asp Dot Net Mcqs
C Language Mcqs
C Plus Plus Mcqs
C Sharp Mcqs
CCNA Mcqs
Computer Networking Mcqs
CSS Mcqs
Data Mining Mcqs
Data Structures and Algorithms Mcqs
Dataware Housing Mcqs
Django Mcqs
DOS Mcqs
Firewall Mcqs
Hibernation Mcqs
Html Mcqs
Html5 Mcqs
Java Mcqs
Javascript Mcqs
Jquery Mcqs
Json Mcqs
Magneto Mcqs
Mysql Mcqs
Python Mcqs
Wordpress Mcqs
Apache Flex Mcqs
Apache Server Mcqs
Introduction To Programming Mcqs
JSP and Servlet Mcqs
Linux Mcqs
Oracle Database Mcqs
PostgreSql Mcqs
SAP ABAP Mcqs
Software Quality Assurance Mcqs
System Analysis Mcqs
Salesforce Development Mcqs
System Programming Mcqs
Visual Basics Mcqs
TCP and IP Mcqs
Machine Learning Mcqs
R Programming Mcqs
Rest Programming Mcqs
Swift Programming Mcqs
Virtual Private Networks VPN Mcqs
Checkpoint Security Mcqs
Unity 3D Mcqs
Bootstrap Mcqs
Information Technology Mcqs
Programming Languages Mcqs
Signals and Systems Mcqs
Web Programming Mcqs
Windows 10 Mcqs
Go Programming Mcqs
Applet Mcqs
java AWT and Swing Mcqs
IP Addressing and Routing Mcqs
Application Software Mcqs
Artificial Intelligence Mcqs
Information System and Security Mcqs
Data Transmission Mcqs
Data Security Mcqs
Central Processing Unit Mcqs
Hard Drive Mcqs
All Subject Mcqs
Pakistan Studies Mcqs
Biology Mcqs
Accounting Mcqs
Agriculture Mcqs
Auditing Mcqs
Checmical Engineering Mcqs
Chemistry Mcqs
Civil Engineering Mcqs
Computer Science Mcqs
Economics Mcqs
Electrical Engineering Mcqs
English Mcqs
English Literature Mcqs
Everyday Science Mcqs
Finance Mcqs
General Knowledge Mcqs
Human Resource Management Mcqs
Islamic Studies Mcqs
Judiciary and law Mcqs
Marketing Mcqs
Mathematics Mcqs
Mechanical Engineering Mcqs
Medical Mcqs
Pakistan Studies Mcqs
Pedagogy Mcqs
Physics Mcqs
Political Science Mcqs
Psychology Mcqs
Sociology Mcqs
Software Engineering Mcqs
Statistics Mcqs
IT and Programming Mcqs
Graphic Design and Multimedia Mcqs
Aptitude Test Mcqs
Current Affairs Mcqs