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

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

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 105 times, 1 visits today)