1. Question: Which statement will you add in the following program to work it correctly? #include<stdio.h> int main() { printf("%f\n", log(36.0)); return 0; }

    A
    #include<conio.h>

    B
    #include<math.h>

    C
    #include<stdlib.h>

    D
    #include<dos.h>

    Note: Not available
    1. Report
  2. Question: We want to round off x, a float, to an int value, The correct way to do is

    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)

    Note: Not available
    1. Report
  3. Question: The binary equivalent of 5.375 is

    A
    101.101110111

    B
    101.011

    C
    101011

    D
    None of above

    Note: Not available
    1. Report
  4. Question: A float occupies 4 bytes. If the hexadecimal equivalent of these 4 bytes are A, B, C and D, then when this float is stored in memory in which of the following order do these bytes gets stored?

    A
    ABCD

    B
    DCBA

    C
    0xABCD

    D
    Depends on big endian or little endian architecture

    Note: Not available
    1. Report
  5. Question: What will you do to treat the constant 3.14 as a float?

    A
    use float(3.14f)

    B
    use 3.14f

    C
    use f(3.14)

    D
    use (f)(3.14)

    Note: Not available
    1. Report
  6. Question: 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't divide

    Note: Not available
    1. Report
  7. Question: What is (void*)0?

    A
    Representation of NULL pointer

    B
    Representation of void pointer

    C
    Error

    D
    None of above

    Note: Not available
    1. Report
  8. Question:  Can you combine the following two statements into one?
    char *p;
    p = (char*) malloc(100);

    A
    char p = *malloc(100);

    B
    char *p = (char) malloc(100);

    C
    char *p = (char*)malloc(100);

    D
    char *p = (char *)(malloc*)(100);

    Note: Not available
    1. Report
  9. Question: In which header file is the NULL macro defined?

    A
    stdio.h

    B
    stddef.h

    C
    stdio.h and stddef.h

    D
    math.h

    Note: Not available
    1. Report
  10. Question: How many bytes are occupied by near, far and huge pointers (DOS)?

    A
    near=2 far=4 huge=4

    B
    near=4 far=8 huge=8

    C
    near=2 far=4 huge=8

    D
    near=4 far=4 huge=8

    Note: Not available
    1. Report
Copyright © 2024. Powered by Intellect Software Ltd