Aptitude Test C Programming For Data Types

Welcome to Your Quiz: Aptitude Test C Programming For Data Types

Name Email
1. What is short int in C programming?
2. The number of digits present after decimal in float is________.
3. Select the odd one out with respect to type?
4. What is the size of float in a 32-bit compiler?
5. Which of the following % operation is invalid?
6. Which is correct with respect to size of the datatypes?
7. What is the output of this C code (on a 32-bit machine)?
    int main()
    {
        int x = 10000;
        double y = 56;
        int *p = &x;
        double *q = &y;
        printf("p and q are %d and %d", sizeof(p), sizeof(q));
        return 0;
    }
8. What is the output of this C code?
    int main()
    {
       char chr;
       chr = 128;
       printf("%d\n", chr);
       return 0;
    }
9. Which data type is most suitable for storing a number 65000 in a 32-bit system?
10. Comment on the output of this C code?
    int main()
    {
        float f1 = 0.1;
        if (f1 == 0.1f)
            printf("equal\n");
        else
            printf("not equal\n");
    }
11. %f access specifier is used for?
12. What is the output of this C code?
    int main()
    {
        float x = 'a';
        printf("%f", x);
        return 0;
    }
13. What is the size of an int data type?
14. Which of the datatypes have size that is variable?
15. Comment on the output of this C code?
    int main()
    {
        float f1 = 0.1;
        if (f1 == 0.1)
            printf("equal\n");
        else
            printf("not equal\n");
    }
16. Loss in precision occurs for typecasting from____________.
17. Comment on the output of this C code?
    int main()
    {
        int a[5] = {1, 2, 3, 4, 5};
        int i;
        for (i = 0; i < 5; i++)
            if ((char)a[i] == '5')
                printf("%d\n", a[i]);
            else
                printf("FAIL\n");
    }
18. The format identifier ‘%i’ is also used for _____ data type?
19. Which of the following is a User-defined data type?
20. What is the output of this C code?
    int main()
    {
        float a = 5.477777777777;
        printf("%f", a);
    }

Thank You for Submitting your response for Quiz

Aptitude Test C Programming For Data Types

Please click on View Result Button to see the Result.



(Visited 116 times, 1 visits today)