MCQOPTIONS
Saved Bookmarks
This section includes 6 Mcqs, each offering curated multiple-choice questions to sharpen your Myntra knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Follow the code snippet and chose the correct statement(s) Int x; void f2() { Int x=1; // line1 ::x=2; // line2 x=2; //line3 } |
| A. | The statement in line1 throws a compilation error |
| B. | In line2,x=2 is assigned to the global x |
| C. | In line3,x=2 is assigned to the global x and line2 throws compilation error |
| D. | Both A and B |
| Answer» C. In line3,x=2 is assigned to the global x and line2 throws compilation error | |
| 2. |
Which of the following is function of relational operator? |
| A. | It assigns one operand to another. |
| B. | It compares two operands |
| C. | It logically combines two operands |
| D. | None of these |
| Answer» C. It logically combines two operands | |
| 3. |
What will be output of following program? #include Int main(int argc, char** argv) { Int i Var=0,iCnt, 0aiArr[]={56,23,4,89,-200,34}; For (iCnt=1;iCnt<6;iCnt++) { If (a I Arr [iCnt] iVar=iCnt; } printf("%d",iVar); return0; } |
| A. | 4 |
| B. | 89 |
| C. | 3 |
| D. | -200 |
| Answer» B. 89 | |
| 4. |
Mitti wants to find the largest number in a given 20 numbers. Which of the following is an efficient approach to do this? |
| A. | Use bubble sort to sort the list in descending order and then print the first number of the series. |
| B. | Use selection sort to sort the list in descending order and then print the first number of the series |
| C. | Implement one iteration of selection sort for descending order and print the first number in the series. |
| D. | None of these |
| Answer» D. None of these | |
| 5. |
What will be output of following program? #include #include int main(){ int register a; scanf("%d",&a); printf("%d",a); return 0; } //if a=25 |
| A. | 25 |
| B. | Address |
| C. | 0 |
| D. | Compilation error |
| Answer» E. | |
| 6. |
What will be output of following program? #include #include int main(){ char far *p,*q; printf("%d %d",sizeof(p),sizeof(q)); return 0; } |
| A. | 2 2 |
| B. | 4 4 |
| C. | 4 2 |
| D. | 2 4 |
| Answer» C. 4 2 | |