Q.1

Which of the following statement is true?

  • Cohesion is the OO principle most closely associated with hiding implementation details
  • Cohesion is the OO principle most closely associated with making sure that classes know about other classes only through their APIs
  • Cohesion is the OO principle most closely associated with making sure that a class is designed with a single, well-focused purpose
  • None
Q.2

What will be output when you will execute following c code?

#include <stdio.h>
void main()

{
    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] );
}

  • 2.000000
  • 4.000000
  • 8.000000
  • Compilation error
Q.3

How many times i value is checked in the below code?

       #include <stdio.h>
        int main()
        {
            int i = 0;
            do {
                i++;
                printf( "In while loopn" );
            } while (i < 3);
        }

  • 2
  • 3
  • 4
  • 1
Q.4

Which Of The Following Statements Is Most Accurate For The Declaration X = Circle()?

  • x contains a reference to a Circle object
  • You can assign an int value to x
  • x contains an object of the Circle type
  • x contains an int value
Q.5

What is the output of this C code?

       #include <stdio.h>
        void main()
        {
            int x = 1, z = 3;
            int y = x << 3;
            printf( "%dn", y );
        }

  • -2147483648
  • -1
  • Run time error
  • 8
Q.6

Output of the Program :

main()

{

int i = 1;

while (i <= 5)

    {

         printf( "%d", i );

         if (i > 2) goto here;

         i++;

     }

}

fun()

{

here : printf( "PP" );

}

  • 1
  • 2
  • Compilation error
  • Exception occurs
Q.7

What will be output of the following c program ?

#include

int main()

{

    int max-val=100;

    int min-val=10;

    int avg-val;

    avg-val =( max-val + min-val ) / 2;

    printf( "%d", avg-val );

    return 0;

}

  • 55
  • 105
  • 60
  • Compilation error
Q.8

What would be the output of the following program ?

main() 

{

       unsigned  int a = oxffff;

        ~a;

        printf ("%x", a);

}

  • ffff
  • 0000
  • 00ff
  • None of the above
Q.9

void main()

{

char good *better, *best;

printf( "%d..%d", sizeof(better), sizeof(best) );

}

  • 1..2
  • 4..4
  • 4..2
  • 2..2
Q.10

What will be output when you will execute following c code?

#include <stdio.h>
enum actor

{
    SeanPenn=5,
    AlPacino=-2,
    GaryOldman,
    EdNorton
};
void main()

{
     enum actor a=0;
     switch(a)

      {
         case SeanPenn:  printf("Kevin Spacey");
                         break;
         case AlPacino:  printf("Paul Giamatti");
                         break;
         case GaryOldman:printf("Donald Shuterland");
                         break;
         case EdNorton:  printf("Johnny Depp");
      } 
}

  • Kevin Spacey
  • Paul Giamatti
  • Donald Shuterland
  • Johnny Depp
Q.11

 What is the output of this C code? 

        #include <stdio.h>
        void m()
        {
            printf("hi");
        }
        void main()
        {
            m();
        }

  • hi
  • Run time error
  • None
  • Varies
Q.12

The output of the code below is

        #include <stdio.h>
        int *m()
        {
            int *p = 5;
            return p;
        }
        void main()
        {
            int *k = m();
            printf("%d", k);
        }

  • 5
  • Junk value
  • 0
  • Error
Q.13

What is the output of this C code?

        #include <stdio.h>
        void main()
        {
            int y = 3;
            int x = 5 % 2 * 3 / 2;
            printf("Value of x is %d", x);
        }

  • Value of x is 1
  • Value of x is 2
  • Value of x is 3
  • Compile time error
Q.14

Macro flowchart is also called as

  • Less Detail flowchart
  • More detail flowchart
  • Simple detailed flowchart
  • None of the above
Q.15

A source program is the program written in which level language  ?

  • Alpha Numeric
  • High-Level
  • Symbolic
  • Machine
Q.16

The coding or scrambling of data so that humans cannot read them, is known as _____.

  • Compression
  • Encryption
  • Ergonomics
  • Biometrics
Q.17

main()

{

char *p; p = "Hello";

printf ("%cn", *&*p);

}

  • H
  • Hello
  • Compilation error
  • H E L L O
Q.18

main()

{

char s[ ] = "man";

int i;

for( i=0; s[ i ]; i++)

printf( "n%c%c%c%c", s[ i ], *(s+i), *(i+s), i[s] );

}

  • mmmm aaaa nnnn
  • aaaa mmmm nnnn
  • nnnn aaaa mmmm
  • None
Q.19

What is the output of this C code?

   #include <stdio.h>
    int main()
    {
        int a = 1, b = 1;
        switch (a)
        {
        case a*b:
            printf("yes ");
        case a-b:
            printf("non");
            break;
        }
    }

  • yes
  • no
  • Compile time error
  • yes no
Q.20

Which of the following is not a valid escape code?

  • "
  • \
  • '
  • =
0 h : 0 m : 1 s