1. Question: Which of the following special symbol allowed in a variable name?

    A
    * (asterisk)

    B
    | (pipeline)

    C
    - (hyphen)

    D
    _ (underscore)

    Note: Not available
    1. Report
  2. Question: By default a real number is treated as a

    A
    float

    B
    double

    C
    long double

    D
    far double

    Note: In computing, 'real number' often refers to non-complex floating-point numbers. It include both rational numbers, such as 42 and 3/4, and irrational numbers such as pi = 3.14159265... When the accuracy of the floating point number is insufficient, we can use the double to define the number. The double is same as float but with longer precision and takes double space (8 bytes) than float. To extend the precision further we can use long double which occupies 10 bytes of memory space.
    1. Report
  3. Question: When we mention the prototype of a function?

    A
    Defining

    B
    Declaring

    C
    Prototyping

    D
    Calling

    Note: A function prototype in C or C++ is a declaration of a function that omits the function body but does specify the function's name, argument types and return type. While a function definition specifies what a function does, a function prototype can be thought of as specifying its interface.
    1. Report
  4. Question: What are the types of linkages?

    A
    Internal and External

    B
    External, Internal and None

    C
    External and None

    D
    Internal

    Note: External Linkage-> means global, non-static variables and functions. Internal Linkage-> means static variables and functions with file scope. None Linkage-> means Local variables.
    1. Report
  5. Question: Is the following statement a declaration or definition? extern int i;

    A
    Declaration

    B
    Definition

    C
    Function

    D
    Error

    Note: Declaring is the way a programmer tells the compiler to expect a particular type, be it a variable, class/struct/union type, a function type (prototype) or a particular object instance. (ie. extern int i) Declaration never reserves any space for the variable or instance in the program's memory; it simply a "hint" to the compiler that a use of the variable or instance is expected in the program. This hinting is technically called "forward reference".
    1. Report
  6. Question: Identify which of the following are declarations 1 : extern int x; 2 : float square ( float x ) { ... } 3 : double pow(double, double);

    A
    1

    B
    2

    C
    1 and 3

    D
    2

    Note: extern int x; - is an external variable declaration. double pow(double, double); - is a function prototype declaration. Therefore, 1 and 3 are declarations. 2 is definition.
    1. Report
  7. Question: Which of the following correctly represents a long double constant?

    A
    6.68

    B
    6.68L

    C
    6.68f

    D
    6.68LF

    Note: 6.68 is double. 6.68L is long double constant. 6.68f is float constant. 6.68LF is not allowed in c.
    1. Report
  8. Question: Which of the declaration is correct?

    A
    int length;

    B
    char int;

    C
    int long;

    D
    float double;

    Note: int length; denotes that variable length is int(integer) data type. char int; here int is a keyword cannot be used a variable name. int long; here long is a keyword cannot be used a variable name. float double; here double is a keyword cannot be used a variable name. So, the answer is int length;(Option A).
    1. Report
  9. Question: Which of the following operations are INCORRECT?

    A
    int i = 35; i = i%5;

    B
    short int j = 255; j = j;

    C
    long int k = 365L; k = k;

    D
    float a = 3.14; a = a%3;

    Note: float a = 3.14; a = a%3; gives "Illegal use of floating point" error. The modulus (%) operator can only be used on integer types. We have to use fmod() function in math.h for float values.
    1. Report
  10. Question: Which of the structure is incorrect?
    1 : struct aa
         {
           int a;
           float b;
         };
    2 : struct aa
        {
           int a;
           float b;
           struct aa var;
        };
    3 : struct aa
        {
           int a;
           float b;
           struct aa *var;
        }

    A
    1

    B
    2

    C
    3

    D
    1,2,3

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