Programming Languages Fundamentals: Python, C, and C++
Test your knowledge of fundamental concepts in Python, C, and C++ programming languages including data types, structures, pointers, functions, templates, and object-oriented programming features.
Questions
Which of the following are storage qualifiers in C++ ?
- const
- volatile
- mutable
- All the Above
- None of the Above
Which of the following exists in C++?
- virtual destructor
- virtual constructor
- Both A and B
- None of the Above
A template can be instantiated by
- Explicit Instantiation
- Implicit instantiation
- Both A and B
- None of the Above
The member functions of a class can be defined outside the Class using
- Extraction Operator
- Insertion Operator
- Scope resolution operator
- None of the Above
The other name for external variables in C++ is
- static variables
- register variables
- global variables
- None of the Above
Class that reads and writes to an array in memory is
- ostream
- ifstream
- strstream
- None of the Above
Can a copy constructor accept an object of the same class as parameter, instead of reference of the object?
- True
- False
What happens when the following program is validated? void main() { void ptr = (void) malloc(sizeof(void)); ptr++ ; }
- CompilationFails
- Will Throw RunTime Error But Code will get Compiled
- Throws Linker Error
- All the above statements are invalid
Is the following statement valid. double price = 7,450.98;
- True
- False
We need to have a structure day of type date which has the following values. Date day = {17,2,2011}; Will the following Structure declaration Correct? struct date { int mm ; int dd ; date year ; }day;
- True
- False
Using pointers to call a function is called as
- call by value
- call by reference
- call by address
- All the Above
What will be the output of the following code? #include<stdio.h> #include<conio.h> void main() { char c=-'a'; printf("%d",c); }
- 65
- -65
- 97
- -97
- CompilationError
The insertion of the code of a called function at the point where The function gets called is achieved by
- Inline functions
- virtual functions
- Both A and B
- None of the Above
What will be the output of the following code segment? #include<stdio.h> #include<conio.h> void main() { int a[]={0,1,2,3,4,5,6,7,8,9,10}; int i=0,num; num=a[++i+a[++i]]+a[++i]; printf("%d",num); }
- 6
- 7
- 8
- 9
- CompilationError
What will be the output of following code segment? #include<stdio.h> #include<conio.h> void main() { char c=-'a'; printf("%d",c); }
- 65
- -65
- 97
- -97
- CompilationError
What will be the output of following code segment? #include<stdio.h> int main() { int num,a=5; num=-a--; printf("%d %d",num,a); }
- 5,4
- -4,4
- -5,4
- -4,5
- Compilation Error
Is python a loosely typed language.?
- True
- False
Is python an object oriented language.?
- True
- False
Which of the following is an invalid data type in python ?
- string
- complex
- double
- float
How many number of structures are there in python ?
- 2
- 3
- 4
- 5