Which of the following is not user defined data type?

  • 0 replies
  • 2020 views
*

Offline mechanic

  • Engineer
  • *****
  • 3420
  • Gender: Male
  • Engineer
    • View Profile
    • Engineering Forum
Which of the following is not user defined data type?
« on: April 28, 2016, 02:50:20 PM »
Question: Which of the following is not user defined data type?

1.
Code: [Select]
struct book
{
    char name[10];
    float price;
    int pages;
};


2.
Code: [Select]
long int l = 2.35;

3.
Code: [Select]
enum day {Sun, Mon, Tue, Wed};
Options are:

A.    1   
B.    2
C.    3   
D.    Both 1 and 2

Correct answer is:

B.    2



Explanation:

C data types classification are

1. Primary data types
        int
        char
        float
        double
        void
2. Secondary data types (or) User-defined data type
        Array
        Pointer
        Structure
        Union
        Enum

So, clearly long int l = 2.35; is not User-defined data type.
(i.e.long int l = 2.35; is the answer.)