MCQOPTIONS
Saved Bookmarks
This section includes 37 Mcqs, each offering curated multiple-choice questions to sharpen your Technical Questions knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Which Of The Following Statements Is Most Accurate For The Declaration X = Circle()? |
| A. | x contains a reference to a Circle object |
| B. | You can assign an int value to x |
| C. | x contains an object of the Circle type |
| D. | x contains an int value |
| Answer» B. You can assign an int value to x | |
| 2. |
What would be the output of the following program ?_x005F_x000D_ main() _x005F_x000D_ {_x005F_x000D_     unsigned  int a = oxffff;_x005F_x000D_     ~a;_x005F_x000D_     printf ("%x", a);_x005F_x000D_ } |
| A. | ffff |
| B. | |
| C. | 00ff |
| D. | None of the above |
| Answer» B. | |
| 3. |
What would be the output of the following program ?_x005F_x000D_ main()_x005F_x000D_ {_x005F_x000D_ Â Â Â const int x = 5;Â _x005F_x000D_ Â Â Â int *ptrx;_x005F_x000D_ Â Â Â ptrx = &x;_x005F_x000D_ Â Â Â *ptr = 10;_x005F_x000D_ Â Â Â Â printf ("%d", x);_x005F_x000D_ } |
| A. | 5 |
| B. | 10 |
| C. | Error |
| D. | Garbage value |
| Answer» C. Error | |
| 4. |
What will be output when you will execute following c code?#include void main()_x005F_x000D_ {Â Â Â int const SIZE = 5;Â Â Â int expr;Â Â Â double value[SIZE] = { 2.0, 4.0, 6.0, 8.0, 10.0 };Â Â Â expr=1|2|3|4;Â Â Â printf ( "%f", value[expr] );} |
| A. | 2 |
| B. | 4 |
| C. | 8 |
| D. | Compilation error |
| Answer» E. | |
| 5. |
What will output when you compile and run the following code?#include struct student{_x005F_x000D_ int roll;int cgpa;int sgpa[8];_x005F_x000D_ };_x005F_x000D_ void main(){_x005F_x000D_ struct student s = { 12,8,7,2,5,9 };int *ptr;ptr = (int *)&s;clrscr();printf( "%d", *(ptr+3) );getch();_x005F_x000D_ } |
| A. | 8 |
| B. | 7 |
| C. | 2 |
| D. | Compiler error |
| Answer» D. Compiler error | |
| 6. |
What will be output when you will execute following c code?#include void main()_x005F_x000D_ {Â Â Â Â switch(2)_x005F_x000D_ Â Â Â {Â Â Â Â Â Â case 1L:printf("No");Â Â Â Â Â Â case 2L:printf("%s","I");Â Â Â Â Â Â Â goto Love;Â Â Â Â Â Â case 3L:printf("Please");Â Â Â Â Â Â case 4L:Love:printf("Hi");Â Â Â Â } } |
| A. | I |
| B. | IPleaseHi |
| C. | IHi |
| D. | Compilation error |
| Answer» D. Compilation error | |
| 7. |
What will be output when you will execute following c code?#include void main()_x005F_x000D_ {   signed int a = -1;   unsigned int b = -1u;   if(a == b)        printf( "The Lord of the Rings" );   else        printf( "American Beauty" );} |
| A. | The Lord of the Rings |
| B. | American Beauty |
| C. | Compilation error: Cannot compare signed number with unsigned number |
| D. | Warning: Illegal operation |
| Answer» B. American Beauty | |
| 8. |
What will be output when you will execute following c code?#include enum actor_x005F_x000D_ {   SeanPenn=5,   AlPacino=-2,   GaryOldman,   EdNorton};void main()_x005F_x000D_ {    enum actor a=0;    switch(a)_x005F_x000D_    {     case SeanPenn: printf("Kevin Spacey");                        break;     case AlPacino: printf("Paul Giamatti");                        break;     case GaryOldman:printf("Donald Shuterland");                        break;     case EdNorton: printf("Johnny Depp");   } } |
| A. | Kevin Spacey |
| B. | Paul Giamatti |
| C. | Donald Shuterland |
| D. | Johnny Depp |
| Answer» E. | |
| 9. |
What will be output of the following c program ?_x005F_x000D_ #include_x005F_x000D_ int main()_x005F_x000D_ {_x005F_x000D_ Â Â int max-val=100;_x005F_x000D_ Â Â int min-val=10;_x005F_x000D_ Â Â int avg-val;_x005F_x000D_ Â Â avg-val =( max-val + min-val ) / 2;_x005F_x000D_ Â Â printf( "%d", avg-val );_x005F_x000D_ Â Â return 0;_x005F_x000D_ } |
| A. | 55 |
| B. | 105 |
| C. | 60 |
| D. | Compilation error |
| Answer» E. | |
| 10. |
What will be output of following program ?_x005F_x000D_ #includeint main()_x005F_x000D_ {_x005F_x000D_ int a = 10;void *p = &a;int *ptr = p;printf("%u",*ptr);return 0;_x005F_x000D_ } |
| A. | 10 |
| B. | Address |
| C. | 2 |
| D. | Compilation error |
| Answer» B. Address | |
| 11. |
What value does read() return when it has reached the end of a file? |
| A. | 1 |
| B. | -1 |
| C. | 0 |
| D. | None |
| Answer» C. 0 | |
| 12. |
What is the output of this C code?_x005F_x000D_        #include        void main()       {           int x = 97;           char y = x;           printf("%cn", y);       } |
| A. | a |
| B. | 97 |
| C. | Run time error |
| D. | None |
| Answer» B. 97 | |
| 13. |
What is the output of this C code?_x005F_x000D_     #include        void main()       {           int y = 3;           int x = 5 % 2 * 3 / 2;           printf("Value of x is %d", x);       } |
| A. | Value of x is 1 |
| B. | Value of x is 2 |
| C. | Value of x is 3 |
| D. | Compile time error |
| Answer» B. Value of x is 2 | |
| 14. |
What is the output of this C code?_x005F_x000D_     #include        void main()       {           int x = 1, z = 3;           int y = x |
| A. | -2147483648 |
| B. | -1 |
| C. | Run time error |
| D. | 8 |
| Answer» E. | |
| 15. |
What is the output of this C code?_x005F_x000D_   #include    int main()   {       int a = 1, b = 1;       switch (a)       {       case a*b:           printf("yes ");       case a-b:           printf("non");           break;       }   } |
| A. | yes |
| B. | no |
| C. | Compile time error |
| D. | yes no |
| Answer» D. yes no | |
| 16. |
What is math.floor(3.6)? |
| A. | 6 |
| B. | 3 |
| C. | 3.5 |
| D. | 0.6 |
| Answer» C. 3.5 | |
| 17. |
We want to round off x, a Float to an Int value. The correct way to do so would be |
| A. | Y = ( int ) ( x + 0.5 ) ; |
| B. | Y = int ( x + 0.5) ; |
| C. | Y = ( int ) x + 0.5; |
| D. | Y = ( int ) ( ( int ) x + 0.5 ) |
| Answer» B. Y = int ( x + 0.5) ; | |
| 18. |
void main()_x005F_x000D_ {_x005F_x000D_ char good *better, *best;_x005F_x000D_ printf( "%d..%d", sizeof(better), sizeof(best) );_x005F_x000D_ } |
| A. | 1..2 |
| B. | 4..4 |
| C. | 4..2 |
| D. | 2..2 |
| Answer» D. 2..2 | |
| 19. |
The output of the code below is_x005F_x000D_     #include        void main()       {           int i = 0, k;           if ( i == 0 )               goto label;               for ( k = 0;k < 3; k++ )               {                   printf( "hin" );                   label: k = printf( "%03d", i );               }     } |
| A. | 0 |
| B. | hi hi hi 0 0 0 |
| C. | 0 hi hi hi 0 0 0 |
| D. | 0 0 0 |
| Answer» B. hi hi hi 0 0 0 | |
| 20. |
The output of the code below is_x005F_x000D_        #include        int *m()       {           int *p = 5;           return p;       }       void main()       {           int *k = m();           printf("%d", k);       } |
| A. | 5 |
| B. | Junk value |
| C. | 0 |
| D. | Error |
| Answer» B. Junk value | |
| 21. |
The coding or scrambling of data so that humans cannot read them, is known as _____. |
| A. | Compression |
| B. | Encryption |
| C. | Ergonomics |
| D. | Biometrics |
| Answer» C. Ergonomics | |
| 22. |
SNOBOL is mainly used for |
| A. | Text Operation |
| B. | String operations |
| C. | List operations |
| D. | Numerical operations |
| Answer» C. List operations | |
| 23. |
public abstract interface Frobnicate { public void twiddle(String s); }Â _x005F_x000D_ Which is a correct class? |
| A. | public abstract class Frob implements Frobnicate { public abstract void twiddle(String s) { } } |
| B. | public abstract class Frob implements Frobnicate { } |
| C. | public class Frob extends Frobnicate { public void twiddle(Integer i) { } } |
| D. | public class Frob implements Frobnicate { public void twiddle(Integer i) { } } |
| Answer» C. public class Frob extends Frobnicate { public void twiddle(Integer i) { } } | |
| 24. |
Output of the Program :_x005F_x000D_ main()_x005F_x000D_ {_x005F_x000D_ int i = 1;_x005F_x000D_ while (i 2) goto here;_x005F_x000D_ Â Â Â Â Â i++;_x005F_x000D_ Â Â Â }_x005F_x000D_ }_x005F_x000D_ fun()_x005F_x000D_ {_x005F_x000D_ here : printf( "PP" );_x005F_x000D_ } |
| A. | 1 |
| B. | 2 |
| C. | Compilation error |
| D. | Exception occurs |
| Answer» D. Exception occurs | |
| 25. |
Methods declared as what cannot be overriden? |
| A. | Transcient |
| B. | Abstract |
| C. | Final |
| D. | Super |
| Answer» D. Super | |
| 26. |
main()_x005F_x000D_ {_x005F_x000D_ char s[ ] = "man";_x005F_x000D_ int i;_x005F_x000D_ for( i=0; s[ i ]; i++)_x005F_x000D_ printf( "n%c%c%c%c", s[ i ], *(s+i), *(i+s), i[s] );_x005F_x000D_ } |
| A. | mmmm aaaa nnnn |
| B. | aaaa mmmm nnnn |
| C. | nnnn aaaa mmmm |
| D. | None |
| Answer» B. aaaa mmmm nnnn | |
| 27. |
main()_x005F_x000D_ {_x005F_x000D_ char *p; p = "Hello";_x005F_x000D_ printf ("%cn", *&*p);_x005F_x000D_ } |
| A. | H |
| B. | Hello |
| C. | Compilation error |
| D. | H E L L O |
| Answer» B. Hello | |
| 28. |
Macro flowchart is also called as |
| A. | Less Detail flowchart |
| B. | More detail flowchart |
| C. | Simple detailed flowchart |
| D. | None of the above |
| Answer» B. More detail flowchart | |
| 29. |
In programming, repeating some statements is usually called  ? |
| A. | Running |
| B. | Structure |
| C. | Looping |
| D. | Control structure |
| Answer» D. Control structure | |
| 30. |
In HTML, ___________ tag is used to construct drop-down list boxes and scrolling list boxes. |
| A. | <SELECT> |
| B. | <OPTION> |
| C. | <TEXTAREA> |
| D. | <INPUT> |
| Answer» B. <OPTION> | |
| 31. |
If the following program (myprog) is run from the command line as _x005F_x000D_ myprog 1 2 3 _x005F_x000D_ what would be the output?_x005F_x000D_ main(int argc, char *argv[])_x005F_x000D_ {_x005F_x000D_   int i, j = 0;_x005F_x000D_   for (i = 0; i < argc ; i++)_x005F_x000D_       j = j + atoi ( argv[i]);_x005F_x000D_   printf ("%d", j);_x005F_x000D_ } |
| A. | 123 |
| B. | 6 |
| C. | Error |
| D. | "123" |
| Answer» C. Error | |
| 32. |
How many times i value is checked in the below code?_x005F_x000D_       #include        int main()       {           int i = 0;           do {               i++;               printf( "In while loopn" );           } while (i < 3);       } |
| A. | 2 |
| B. | 3 |
| C. | 4 |
| D. | 1 |
| Answer» C. 4 | |
| 33. |
enum colors {BLACK,BLUE,GREEN}_x005F_x000D_ main()_x005F_x000D_ {_x005F_x000D_ printf( "%d..%d..%d", BLACK, BLUE, GREEN );_x005F_x000D_ return(1);_x005F_x000D_ } |
| A. | 1..2..3 |
| B. | 0..1..2 |
| C. | 1..1..1 |
| D. | 0..0..0 |
| Answer» C. 1..1..1 | |
| 34. |
#define clrscr() 100_x005F_x000D_ main()_x005F_x000D_ {_x005F_x000D_ clrscr();_x005F_x000D_ printf( "%dn", clrscr() );_x005F_x000D_ } |
| A. | 100 |
| B. | |
| C. | Compilation error |
| D. | Exception occurs |
| Answer» B. | |
| 35. |
All variables in PHP start with which symbol? |
| A. | % |
| B. | ! |
| C. | $ |
| D. | & |
| Answer» D. & | |
| 36. |
A source program is the program written in which level language  ? |
| A. | Alpha Numeric |
| B. | High-Level |
| C. | Symbolic |
| D. | Machine |
| Answer» C. Symbolic | |
| 37. |
What is the output of this C code? _x005F_x000D_        #include        void m()       {           printf("hi");       }       void main()       {           m();       } |
| A. | hi |
| B. | Run time error |
| C. | None |
| D. | Varies |
| Answer» B. Run time error | |