MCQOPTIONS
Saved Bookmarks
This section includes 5 Mcqs, each offering curated multiple-choice questions to sharpen your MAQ-Software knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Write one statement equivalent to the following two statements: x=sqr(a); return(x); |
| A. | return(sqr(a)); |
| B. | printf("sqr(a)"); |
| C. | return(a*a*a); |
| D. | printf("%d",sqr(a)); |
| Answer» B. printf("sqr(a)"); | |
| 2. |
What is the output of the following code? x=15; y=0; if(x=10) y=7; else y=1; cout<< y; |
| A. | 7 |
| B. | 0 |
| C. | 1 |
| D. | 6 |
| Answer» D. 6 | |
| 3. |
Predict the output of the following program: #include<iostream.h> Class Green { int x; } int main() { Green g; cout < return0; } |
| A. | Runtime Error |
| B. | 0 |
| C. | Compiler Error |
| D. | Garbage Value |
| Answer» D. Garbage Value | |
| 4. |
What is the output of this program? class main_class { public static void main(String args[]) { if (a == 20) { int a= 18; System.out.println(x); } } } |
| A. | 20 |
| B. | 18 |
| C. | Compilation error |
| D. | Runtime error |
| Answer» D. Runtime error | |
| 5. |
What will be output of following program? #include<stdio.h> #include<iostream.h> int main(){ register a = 25; int far *p; p=&a; printf("%d ",*p); return 0; } |
| A. | 25 |
| B. | 4 |
| C. | Address |
| D. | Compilation error |
| Answer» E. | |