Data Types


  1. What will be the output of the following C code? (Initial values: p= 10, q = 12)
    #include <stdio.h>
    void main()
    {
    float p;
    int q;
    printf("Enter two numbers: ", p);
    scanf("%f %f", &p, &q);
    printf("%f, %d", p, q);
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: E

    10.000000, Garbage value


  1. What will be the output of the following C code?
    #include <stdio.h>
    void main()
    {
    double n = 23458965.12124;
    int m = n;
    printf("%d", m);
    printf(" %lf", m);
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    23458965, 0.000000



  1. What will be the output of the following C code?
    #include <stdio.h>
    int main()
    {
    int n = 25;
    char ch = -25;
    if (n < ch)
    {
    printf("Yes\n");
    }
    else
    {
    printf("No\n");
    }
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    No


  1. What will be the output of the following C code considering the size of short int is 2, char is 1 and int is 4 bytes?
    #include <stdio.h>
    int main()
    {
    short int k = 23;
    char ch = 99;
    printf("%d, %d, %d\n", sizeof(k), sizeof(ch), sizeof(ch + k));
    return 0;
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    2, 1, 4



  1. function tolower(c) defined in library <ctype.h> works for ___________.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    Any character set