Object Oriented Programming MCQs

Page No. 89

What are automatic variables?


aGlobal variables


bImplicit/temporary variables


cLocal variables


dSystem variables


View Answer Local variables

Why are functions extern by default?


a Because functions are always private


b Because those are not visible throughout the program


cBecause those can’t be accessed in all parts of the program


dBecause those are visible throughout the program



If extern variable is initialized with the declaration then _______________________


aAlso the header file with definition is required


bThe header file with definition must be included


cThere is no need to include any other header file for definition


dThe extern variable produces compile time error



If the definition is given in the header file that we include then ________________


aThe program can run successfully


bAlso the program should define the extern variable


cThe extern variable must contain two definitions


dExtern variable can’t be used in the program



What will be the output of the program?


a10


b11


cRun time error


dCompile time error


View Answer Compile time error

Which is the correct syntax for extern function declaration?


a extern function_name(argument_list);


bextern return_type function_name(argument_list);


cextern (return_type)function_name(argument_list);


dreturn_type extern function_name(argument_list);



Which is the correct syntax for extern variable declaration?


aextern data_type variable_name;


bextern variable_name;


cdata_type variable_name extern;


dextern (data_type)variable_name;



Which of the following results in the allocation of memory for the extern variables?


aDeclaration


bDefinition


c Including file


dMemory is not allocated for extern variables


View Answer Definition

Even if a variable is not declared as extern, it is extern by default.


aTrue


bFalse


cA & B


d None of the above


View Answer False

Whenever a function is declared in a program _____________________


a extern can be used only in some special cases


b extern can’t be used


cfunction is extern by default


d it can’t be made extern



Goto Page No.

Page 89 of 93

Alphabetical MCQs Categories

Here below You find all kind of categories of MCQs in alphabetical order.


"Comprehensive Collection of MCQs: Alphabetically Organized by Subject"

"Discover an extensive collection of multiple-choice questions (MCQs) neatly categorized by subject from A to Z. This resource is designed for anyone eager to explore various topics in a straightforward and organized manner. Whether you're a student preparing for exams, an educator seeking supplementary materials, or simply curious about different subjects, this compilation offers a convenient way to learn and assess your knowledge. With questions arranged alphabetically, navigation is effortless, allowing you to delve into subjects of interest at your own pace. Engage, learn, and expand your understanding with this accessible and comprehensive repository of MCQs!"


BolPakistan

bolpakistan.com.pk includes Job Mcqs and Pak Mcqs is the Top Largest Mcqs Forum in World, in which you can read Mcqs of All Subjects, PPSC test preparation, FPSC, NTS and PPSC PAST PAPERS, PPSC PAST MCQS. A Collection of Repeated MCQs for JOBs seekers.

Copyright © 2024, Designed & Developed by BolPakistan