Clique

25 Questions | Total Attempts: 74

SettingsSettingsSettings
Please wait...
Clique

.


Questions and Answers
  • 1. 
     How many times "CLIQUE" is getting printed?#includeint main(){    int x;    for(x=-1; x<=10; x++)    {        if(x < 5)            continue;        else            break;        printf("CLIQUE");    }    return 0;}
    • A. 

      Infinite times

    • B. 

      0 Times

    • C. 

      11 Times

    • D. 

      10 Times

  • 2. 
    The maximum combined length of the command-line arguments including the spaces between adjacent arguments is
    • A. 

      128 characters

    • B. 

      256 characters

    • C. 

      67characters

    • D. 

      It may vary from one operating system to another

  • 3. 
    What will be the output of the program in TurboC?#include<stdio.h>int fun(int **ptr); int main(){    int i=10, j=20;    const int *ptr = &i;    printf(" i = %5X", ptr);    printf(" ptr = %d", *ptr);    ptr = &j;    printf(" j = %5X", ptr);    printf(" ptr = %d", *ptr);    return 0;}
    • A. 

      I= FFE2 ptr=12 j=FFE4 ptr=24

    • B. 

      I= FFE4 ptr=10 j=FFE2 ptr=20

    • C. 

      I= FFE0 ptr=20 j=FFE1 ptr=30

    • D. 

      Garbage value

  • 4. 
    Which of the following is the correct usage of conditional operators used in C?
    • A. 

      A>b ? c=30 : c=40;

    • B. 

      A>b ? c=30;

    • C. 

      Max = a>b ? a>c?a:c:b>c?b:c

    • D. 

      Return (a>b)?(a:b)

  • 5. 
    In which order do the following gets evaluatedRElational ,logical,arithmetic and assignment operator.
    • A. 

      2134

    • B. 

      1234

    • C. 

      4321

    • D. 

      3214

  • 6. 
    What is x in the following program?#include<stdio.h> int main(){    typedef char (*(*arrfptr[3])())[10];    arrfptr x;    return 0;}
    • A. 

      X is a pointer

    • B. 

      X is an array of three pointer

    • C. 

      X is an array of three function pointers

    • D. 

      Error in x declaration

  • 7. 
    What will be output if you will compile and execute the following c code? #includevoid main(){int i;float a=5.2;char *ptr;ptr=(char *)&a;for(i=0;i<=3;i++)printf(“%d “,*ptr++);} 
    • A. 

      0 0 0 0

    • B. 

      Garbage Garbage Garbage Garbage

    • C. 

      102 56 -80 32

    • D. 

      102 102 -90 64

  • 8. 
    What will be output if you will compile and execute the following c code?int main(){int i=10;static int x=i;if(x==i)printf(“Equal”);else if(x>i)printf(“Greater than”);elseprintf(“Less than”);return 0;}  
    • A. 

      Equal

    • B. 

      Greater than

    • C. 

      Less than

    • D. 

      Compiler error

  • 9. 
    What will be output if you will compile and execute the following c code?#include#define var 3int main(){char *cricket[var+~0]={“clarke”,”kallis”};char *ptr=cricket;printf(“%c”,*++ptr);return 0;} 
    • A. 

      A

    • B. 

      R

    • C. 

      1

    • D. 

      Compilation error

  • 10. 
    What will be output of the following c program?#includeint main(){int class=150;int public=25;int private=30;class = class >> private – public;printf(“%d”,class);return 0;}  
    • A. 

      1

    • B. 

      2

    • C. 

      4

    • D. 

      Compilation error

  • 11. 
    What will be output if you will compile and execute the following c code?#includeint main(){int i=2,j=2;while(i+1?–i:j++)printf(“%d”,i);return 0;}  
    • A. 

      1

    • B. 

      2

    • C. 

      3

    • D. 

      4

  • 12. 
    Predict the data type of the following mathematical operation?
    • A. 

      Int

    • B. 

      Float

    • C. 

      Double

    • D. 

      Long

  • 13. 
    Consider the following C-program:void foo(int n, int sum){  int k = 0, j = 0;  if (n == 0) return;    k = n % 10;  j = n / 10;  sum = sum + k;  foo (j, sum);  printf ("%d,", k);} int main (){  int a = 2048, sum = 0;  foo (a, sum);  printf ("%d\n", sum);     getchar();}
    • A. 

      8, 4, 0, 2, 14

    • B. 

      8, 4, 0, 2, 0

    • C. 

      2, 0, 4, 8, 14

    • D. 

      2, 0, 4, 8, 0

  • 14. 
    Declare the following statement?"An array of three pointers to chars".
    • A. 

      Char *ptr[3]();

    • B. 

      Char *ptr[3];

    • C. 

      Char (*ptr[3])();

    • D. 

      Char **ptr[3];

  • 15. 
    . Consider the C program shown below.# include <stdio.h># define print(x)  printf ("%d", x)int x;void Q(int z){  z += x;  print(z);}void P(int *y){  int x = *y+2;  Q(x);  *y = x-1;  print(x);} main(void){  x=5;  P(&x);  print(x);  getchar();}
    • A. 

      1276

    • B. 

      22 12 11

    • C. 

      14 6 6

    • D. 

      766

  • 16. 
     Which of the following declaration is illegal? 
    • A. 

      Int a = 0, b = 1, c = 2; int array[3] = {a, b, c};

    • B. 

      Int size = 3; int array[size];

    • C. 

      Int size = 3; int array[size] = {1, 2, 3};

    • D. 

      All of the mentioned

  • 17. 
    The sequence of allocation and deletion of variables for the following code is.#include <stdio.h>int main(){int a;{int b;}} 
    • A. 

      A->b, a->b

    • B. 

      A->b, b->a

    • C. 

      B->a, a->b

    • D. 

      B->a, b->a

  • 18. 
    Which of the following gives the memory address of the first element in array? 
    • A. 

      Array[0];

    • B. 

      Array[1];

    • C. 

      Array[2];

    • D. 

      Array

  • 19. 
    Which is used to define the member of a class externally? 
    • A. 

      :

    • B. 

      ::

    • C. 

      #

    • D. 

      None of the above mentioned

  • 20. 
    What is the use of function call operator?
    • A. 

      Overloading the methods

    • B. 

      Overloading the objects

    • C. 

      Overloading the parameters

    • D. 

      None of the mentioned

  • 21. 
    Which class is used to design the base class? 
    • A. 

      Abstract class

    • B. 

      Derived class

    • C. 

      Base class

    • D. 

      None of the mentioned

  • 22. 
    Which of the following concepts means determining at runtime what method to invoke?
    • A. 

      Data hiding

    • B. 

      Dynamic Typing

    • C. 

      Dynamic binding

    • D. 

      Dynamic loading

  • 23. 
    If a class C is derived from class B, which is derived from class A, all through publicinheritance, then a class C member function can access
    • A. 

      Protected and public data only in C and B.

    • B. 

      Protected and public data only in C.

    • C. 

      Private data in A and B.

    • D. 

      Protected data in A and B.

  • 24. 
    What will be the output of the program?#include<stdio.h> int main() { int k, num=30; k = (num>5 ? (num <=10 ? 100 : 200): 500); printf("%d\n", num); return 0; }
    • A. 

      200

    • B. 

      30

    • C. 

      100

    • D. 

      500

  • 25. 
    The keyword used to transfer control from a function back to the calling function is
    • A. 

      Switch

    • B. 

      Goto

    • C. 

      Return

    • D. 

      Go back