C++ Programs Asked in Interview for Freshers - 2
Question: 6
What is file scope?
A variable declared all blocks and functions (precisely main ()) has the scope of a file.
The scope of a file scope variable is the entire program. The life time of a file scope variable is the life time of a program.
Question: 7
How many types of variable scopes are there? What are they?
Scope refers to the accessibility of a variable. There are four types of scopes in C++. They are:
Local scope, File scope and
Function scope, Class scope.
Question: 8
What is meant by void function?
The functions that return no value are declared as void. The data type of a function is treated as int, if no data type is explicitly mentioned.
Question: 9
What is the use of parameters passing in function?
The call statement communicates with the function through arguments or parameters.
Parameters are the channels through which data flows from call statement to function and vice versa.
Question: 10
Write the general syntax of a function prototype. Give an example.
The general syntax of a function prototype
<type > <function identifier> <arguments>;
For example:
Void fun (char);
Int max (int, int);
Int max (int a, int b);
- C++ Interview Questions and Answers for Experienced
- Top 200+ C++ Interview Questions and Answers
- C++ Interview Questions and Answers for Freshers
- Advanced C++ Programming Interview Questions and Answers
- C++ Language Interview Questions for Experienced Pdf
- C++ Programs Asked in Interview for Freshers
- C++ Interview Questions and Answers Pdf
- C++ Language Interview Questions and Answers for Freshers Pdf
- C++ Questions and Answers
- Top 250+ C++ Constructor and Destructor Programming Interview Questions
- C++ basic interview questions and answers pdf
- C++ Programming Interview Questions and Answers
- C++ Technical Interview Questions and Answers
- Top 200+ Advanced C++ Interview Questions 2020-2021
- C++ Lab Viva-Practical Exams Questions and Answers
- C++ Coding Interview Questions and Answers
Electromagnetic Induction Questions & Answers Pdf More
A.C. Basics and Networks Quiz Questions & Answers Pdf More
Signals and Systems Quiz Questions and Answers Pdf More
Signals and Systems MCQ Questions and Answers Pdf More
Electrical Power Sources Quiz Questions & Answers Pdf More
Top 10,000+ Free Online Computer Quiz More
TNPSC Current Affairs Questions and Answers More
Biodiversity Multiple Choice Questions & Answers for TNPSC, NEET More
1000+ CAT Paragraph Completion Questions with Answers More
Top 1000+ Verbal Ability Questions and Answers More