C SHARP interview questions part 34

C SHARP interview questions part 34

Take as many assements as you can to improve your validate your skill rating

Total Questions: 20

1. What is the output of the following C++ code? #include #include using namespace std; int main() { cout<::type>::value; return 0; }

Correct Answer is : s will be created on the stack

2. What is the output of the following C++ code? #include #include using namespace std; int main() { cout<::type>::value; cout<::type>::value; return 0; }

Correct Answer is : All of the mentioned

3. What is the output of the following C++ code? #include #include using namespace std; int main() { cout<::type>::value; return 0; }

Correct Answer is : All of the mentioned

4. Which of the following correctly declares an array?

Correct Answer is : Structures can be declared within a procedure

5. What is the index number of the last element of an array with 9 elements?

Correct Answer is : abc e = new abc();

6. Which of the following accesses the seventh element stored in array?

Correct Answer is : As variable goes out of the scope

7. Which of the following gives the memory address of the first element in array?

Correct Answer is : 12 bytes

8. What will be the output of this program? #include #include using namespace std; int array1[] = {1200, 200, 2300, 1230, 1543}; int array2[] = {12, 14, 16, 18, 20}; int temp, result = 0; int main() { for (temp = 0; temp < 5; temp++) { result += array1[temp]; } for (temp = 0; temp < 4; temp++) { result += array2[temp]; } cout << result; return 0; }

Correct Answer is : 20

9. What will be the output of the this program? #include #include using namespace std; int main () { int array[] = {0, 2, 4, 6, 7, 5, 3}; int n, result = 0; for (n = 0; n < 8; n++) { result += array[n]; } cout << result; return 0; }

Correct Answer is : Elements of ‘q’ will be copied into corresponding elements of p.

10. What do associate containers implement?

Correct Answer is : The code reports an error as missing ; before :

11. By using which of the following the elements in the associate container can be efficiently accessed?

Correct Answer is : The code reports an error as missing ; before :

12. How many items are presented in the associate container?

Correct Answer is : 38050

13. How many instance are allowed by map and set while inserting a element into container?

Correct Answer is : Compile time error

14. What do maps and sets support?

Correct Answer is : Compile time error

15. Which header file is used to manipulate the string?

Correct Answer is : Compile time error

16. How many maximum number of parameters does a string constructor can take?

Correct Answer is : Compile time error

17. Which constant member functions does not modify the string?

Correct Answer is : Compile time error

18. What is the difference between unsigned int length() and unsigned int size()?

Correct Answer is : All of the mentioned

19. How many parameters can a resize method take?

Correct Answer is : Csharp

20. What is bitset in C++?

Correct Answer is : try need not to be followed by anything

Similar Interview Questions

    Search for latest jobs

    Icon
    Icon