inautix technologies programming placement paper level1

Upload: placementpapersample

Post on 04-Apr-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/29/2019 iNautix Technologies programming Placement Paper Level1

    1/12

    Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget

    freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @

    https://www.facebook.com/LatestOffCampus

    Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget

    freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @

    https://www.facebook.com/LatestOffCampus

    TITLE:iNautix Technologies Programming Placement Paper Level1

    (Bolded option is your answer)

    1.What will be the output of the program?

    #include

    int main()

    {

    int y=128;

    const int x=y;

    printf("%d\n", x);return 0;

    }

    A 128 B Garbage value C Error D 0

    2.What will be the output of the program?

    #include

    int main()

    {

    const int x=5;

    const int *ptrx;

    ptrx = &x;

    *ptrx = 10;

    printf("%d\n", x);

    return 0;}

    A 5 B 10 C Error D Garbage value

    http://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttp://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/https://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/
  • 7/29/2019 iNautix Technologies programming Placement Paper Level1

    2/12

    Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget

    freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @

    https://www.facebook.com/LatestOffCampus

    Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget

    freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @

    https://www.facebook.com/LatestOffCampus

    3.What will be the output of the program?

    #include

    int main()

    {

    const c = -11;

    const int d = 34;

    printf("%d, %d\n", c, d);

    return 0;

    }A Error B -11, 34 C 11, 34 D None of these

    4.What will be the output of the program?

    #include

    int main()

    {const char *s = "";

    char str[] = "Hello";

    s = str;

    while(*s)

    printf("%c", *s++);

    return 0;

    }

    A Error B H C Hello D Hel

    http://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttp://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/https://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/
  • 7/29/2019 iNautix Technologies programming Placement Paper Level1

    3/12

    Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget

    freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @

    https://www.facebook.com/LatestOffCampus

    Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget

    freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @

    https://www.facebook.com/LatestOffCampus

    5.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];

    6.What do the following declaration signify?

    int *ptr[30];

    A ptr is a

    pointer

    to an

    array of30

    integer

    pointers.

    B ptr is a array of

    30 pointers to

    integers.

    C ptr is a

    array of 30

    integer

    pointers.

    D ptr is a array 30

    pointers.

    7.What do the following declaration signify?

    int (*pf)();

    A pf is a

    pointer

    to

    function.

    B pf is a function

    pointer.

    C pf is a

    pointer to a

    function

    which return

    int

    D pf is a function of

    pointer variable.

    8.What do the following declaration signify?

    void *cmp();

    A cmp is

    a pointer

    to an

    void type.

    B cmp is a void type

    pointer variable.

    C cmp is a

    function that

    return a void

    pointer.

    D cmp function

    returns nothing.

    http://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttp://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/https://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/
  • 7/29/2019 iNautix Technologies programming Placement Paper Level1

    4/12

    Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget

    freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @

    https://www.facebook.com/LatestOffCampus

    Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget

    freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @

    https://www.facebook.com/LatestOffCampus

    9.Declare the following statement?

    "A pointer to a function which receives nothing and returns nothing".

    A void*(ptr)*int

    ;

    B void *(*ptr)() C void*(*ptr)(*) D void (*ptr)()

    10.What do the following declaration signify?

    char *scr;

    A scr is a

    pointer

    topointer

    variable.

    B scr is a function

    pointer.

    C scr is a

    pointer to

    char.

    D scr is a member of

    function pointer.

    11.Which of the following statements should be used to obtain a

    remainder after dividing 3.14 by 2.1 ?

    A rem =

    3.14 %

    2.1;

    B rem = modf(3.14,

    2.1);

    C rem =

    fmod(3.14,

    2.1);

    D Remainder cannot

    be obtain in floating

    point division.

    12.Which of the following special symbol allowed in a variable name?

    A *

    (asterisk)

    B | (pipeline) C - (hyphen) D _ (underscore)

    13.When we mention the prototype of a function?

    A

    Defining

    B Declaring C Prototyping D Calling

    14.What is the output of the program in Turbo C (in DOS 16-bit OS)?

    #include

    http://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttp://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/https://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/
  • 7/29/2019 iNautix Technologies programming Placement Paper Level1

    5/12

    Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget

    freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @

    https://www.facebook.com/LatestOffCampus

    Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget

    freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @

    https://www.facebook.com/LatestOffCampus

    int main()

    {

    char *s1;

    char far *s2;

    char huge *s3;

    printf("%d, %d, %d\n", sizeof(s1), sizeof(s2), sizeof(s3));

    return 0;

    }

    A 2, 4, 6 B 4, 4, 2 C 2, 4, 4 D 2, 2, 2

    15.What is the output of the program

    #include

    int main()

    {

    int x = 10, y = 20, z = 5, i;

    i = x < y < z;

    printf("%d\n", i);

    return 0;}

    A 0 B 1 C Error D None of these

    16.What is the output of the program

    #include

    int main()

    {

    int a[5] = {2, 3};

    printf("%d, %d, %d\n", a[2], a[3], a[4]);

    return 0;

    http://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttp://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/https://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/
  • 7/29/2019 iNautix Technologies programming Placement Paper Level1

    6/12

    Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget

    freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @

    https://www.facebook.com/LatestOffCampus

    Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget

    freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @

    https://www.facebook.com/LatestOffCampus

    }

    AGarbage

    Values

    B 2, 3, 3 C 3, 2, 2 D 0, 0, 0

    17.What will you do to treat the constant 3.14 as a long double?

    A use

    3.14LD

    B use 3.14L C use 3.14DL D use 3.14LF

    18.Which of the following range is a valid long double (Turbo C in 16 bit

    DOS OS) ?

    A 3.4E-

    4932 to

    1.1E+493

    2

    B 3.4E-4932 to

    3.4E+4932

    C 1.1E-4932

    to 1.1E+4932

    D 1.7E-4932 to

    1.7E+4932

    19.Which of the following statement obtains the remainder on dividing

    5.5 by 1.3 ?

    A rem =(5.5 %

    1.3)

    B rem = modf(5.5,1.3)

    C rem =fmod(5.5,

    1.3)

    D Error: we can'tdivide

    20.Assunming, integer is 2 byte, What will be the output of the

    program?

    #include

    int main(){

    printf("%x\n", -1>>1);

    return 0;

    http://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttp://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/https://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/
  • 7/29/2019 iNautix Technologies programming Placement Paper Level1

    7/12

    Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget

    freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @

    https://www.facebook.com/LatestOffCampus

    Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget

    freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @

    https://www.facebook.com/LatestOffCampus

    }

    A ffff B 0fff C 0000 D fff0

    21.Assuming a integer 2-bytes, What will be the output of the

    program?

    #include

    int main()

    {printf("%x\n", -1(2+1-2)) & (~(1

  • 7/29/2019 iNautix Technologies programming Placement Paper Level1

    8/12

    Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget

    freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @

    https://www.facebook.com/LatestOffCampus

    Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget

    freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @

    https://www.facebook.com/LatestOffCampus

    23.What function should be used to free the memory allocated by

    calloc() ?

    Adealloc(); Bmalloc(variable_na

    me, 0)

    C free(); Dmemalloc(variable_na

    me, 0)

    24.Specify the 2 library functions to dynamically allocate memory?

    A

    malloc()

    and

    memalloc()

    B alloc() and

    memalloc()

    C malloc()

    and calloc()

    D memalloc() and

    faralloc()

    25.Which of the following cannot be checked in a switch-case

    statement?

    A

    Character

    B Integer C Float D enum

    26.What will be the output of the program?

    #include

    int main()

    {

    char ch;

    if(ch = printf(""))

    printf("It matters\n");

    else

    printf("It doesn't matters\n");return 0;

    }

    http://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttp://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/https://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/
  • 7/29/2019 iNautix Technologies programming Placement Paper Level1

    9/12

    Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget

    freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @

    https://www.facebook.com/LatestOffCampus

    Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget

    freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @

    https://www.facebook.com/LatestOffCampus

    A It

    matters

    B It doesn't

    matters

    C matters D No output

    27.What will be the output of the program?

    #include

    int main()

    {

    int k, num = 30;

    k = (num < 10) ? 100 : 200;

    printf("%d\n", num);

    return 0;}

    A 200 B 30 C 100 D 500

    28.What will be the output of the program?

    #include

    int main()

    {

    int a = 300, b, c;

    if(a >= 400)

    b = 300;

    c = 200;

    printf("%d, %d, %d\n", a, b, c);

    return 0;

    }

    A 300,

    300, 200

    B Garbage, 300,

    200

    C 300,

    Garbage, 200

    D 300, 300, Garbage

    29.Point out the error, if any in the program.

    http://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttp://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/https://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/
  • 7/29/2019 iNautix Technologies programming Placement Paper Level1

    10/12

    Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget

    freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @

    https://www.facebook.com/LatestOffCampus

    Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget

    freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @

    https://www.facebook.com/LatestOffCampus

    #include

    int main()

    {

    int a = 10;

    switch(a)

    {

    }

    printf("This is c program.");

    return 0;

    }

    A Error:No case

    statemen

    t

    specified

    B Error: No defaultspecified C No Error D Error: infinite loopoccurs

    30.Point out the error, if any in the program.

    #include

    int main(){

    int a = 10, b;

    a >=5 ? b=100: b=200;

    printf("%d\n", b);

    return 0;

    }

    A 100 B 200 C Error: L

    valuerequired for

    b

    D Garbage value

    http://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttp://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/https://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/
  • 7/29/2019 iNautix Technologies programming Placement Paper Level1

    11/12

    Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget

    freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @

    https://www.facebook.com/LatestOffCampus

    Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget

    freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @

    https://www.facebook.com/LatestOffCampus

    31.In the following code, the P2 is Integer Pointer or Integer?

    typedef int *ptr;

    ptr p1, p2;

    A Integer B Integer pointer C Error in

    declaration

    D None of above

    32.What is x in the following program?

    #include

    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

    threefunction

    pointers

    D Error in x

    declaration

    33.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)

    34.Which of the following is the correct order if calling functions in the

    below code?

    a = f1(23, 14) * f2(12/4) + f3();

    http://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttp://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/https://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/
  • 7/29/2019 iNautix Technologies programming Placement Paper Level1

    12/12

    Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget

    freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @

    https://www.facebook.com/LatestOffCampus

    Visitwww.latestoffcampus.com for placement papers, interview tips & job updates. Toget

    freeupdates tomailhttps://groups.google.com/group/latestoffcampusLive updates on Facebook @

    https://www.facebook.com/LatestOffCampus

    A f1, f2,

    f3

    B f3, f2, f1 C Order may

    vary from

    compiler to

    compiler

    D None of above

    35.Which of the following are unary operators in C?

    1. !

    2. sizeof

    3. ~

    4. &&

    A 1, 2 B 1, 3 C 2, 4 D 1, 2, 3

    36.What will be the output of the program?

    #include

    int main()

    {

    int x=12, y=7, z;

    z = x!=4 || y == 2;

    printf("z=%d\n", z);return 0;

    }

    A z=0 B z=1 C z=4 D z=2

    http://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttp://www.latestoffcampus.com/http://www.latestoffcampus.com/http://www.latestoffcampus.com/https://groups.google.com/group/latestoffcampushttps://groups.google.com/group/latestoffcampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/https://www.facebook.com/LatestOffCampushttps://groups.google.com/group/latestoffcampushttp://www.latestoffcampus.com/