Explore topic-wise MCQs in Technical MCQs.

This section includes 9 Mcqs, each offering curated multiple-choice questions to sharpen your Technical MCQs knowledge and support exam preparation. Choose a topic below to get started.

1.

        Note:Includes all required header filesusing namespace std;    int main ()   {       int find[5];       int * p;       p = find;  *p = 1;       p++;  *p = 2;       p = &find[2];  *p = 3;       p = find + 3;  *p = 4;       p = find;  *(p + 4) = 5;       for (int n = 0; n < 5; n++)           cout << find[n] << ",";       return 0;   }    
20.The correct statement for a function that takes pointer to a float, a pointer to a pointer to a char and returns a pointer to a pointer to a integer is

A. int **fun(float**, char**)
B. int *fun(float*, char*)
C. int ***fun(float*, char**)
D. int ***fun(*float, **char)
E.
Answer» D. int ***fun(*float, **char)
2.

       Note:Includes all required header filesusing namespace std;   int main()   {        int find[] = {1, 2, 3, 4};        int *p = (find + 1);        cout << *find + 9;        return 0;   } 
19.What will be the output of the following program?

A. 1,2,3,4,5,
B. 12345
C. compile error
D. runtime error
Answer» B. 12345
3.

        Note:Includes all required header filesusing namespace std;   int main()   {       int find[] = {1, 2, 3, 4};       int *p = (find + 1);       cout << find;       return 0;   }  
18.What will be the output of the following program?

A. 9
B. 10
C. 11
D. error
Answer» C. 11
4.

        Note:Includes all required header filesusing namespace std;   int main()   {       int find[] = {1, 2, 3, 4};       int *p = (find + 1);       cout << *p;       return 0;   }
17.What will be the output of this program?

A. 1
B. 2
C. address of find
D. 4
Answer» D. 4
5.

#include <iostream>using namespace std;int main(){   int i;   char *lfc[] = {"C", "C++", "Java", "VBA"};   char *(*ptr)[4] = &lfc;   cout << ++(*ptr)[2];   return 0;}  
16.What will be the output of this program?

A. 1
B. 2
C. 3
D. 4
Answer» C. 3
6.

        Note:Includes all required header files using namespace std;   int main()   {       int a[2][4] = {1, 2, 3, 4, 5, 6, 7, 8};       cout << *(a[1] + 2) << *(*(a + 1) + 2) << 2[1[a]];       return 0;   }  
15.Which of the following is true about the following program

A. ava
B. java
C. c++
D. compile time error
Answer» B. java
7.

#include <iostream>using namespace std;int main(){    char *ptr;    char Str[] = "abcdefg";    ptr = Str;    ptr += 5;    cout << ptr;    return 0;}  
14.Which of the following statement is correct about the program given below?

A. 5 6 7
B. 7 7 7
C. 8 8 8
D. Compile time error
Answer» C. 8 8 8
8.

#include <iostream>using namespace std;int main(){    char lfc[20];    int i;    for(i = 0; i < 10; i++)        *(lfc + i) = 65 + i;    *(lfc + i) = ' ';    cout << lfc;    return(0);   } 
13.What is the output of this program?

A. fg
B. cdef
C. defg
D. abcd
Answer» B. cdef
9.

#include <iostream>using namespace std;int main()    {        int x = 1, y = 3, z = 5;        int *lfc[ ] = {&x, &y, &z};        cout << lfc[1];        return 0;    }
12.What is the output of this program?

A. ABCDEFGHIJ
B. AAAAAAAAAA
C. JJJJJJJJ
D. None of the mentioned
Answer» B. AAAAAAAAAA