C Programming - Declarations and Initializations - Discussion

Discussion Forum : Declarations and Initializations - General Questions (Q.No. 7)
Which of the following is not user defined data type?
1 :
struct book
    char name[10];
    float price;
    int pages;
2 :
long int l = 2.35;
3 :
enum day {Sun, Mon, Tue, Wed};
Both 1 and 2
Answer: Option

C data types classification are

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

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

48 comments Page 1 of 5.

Abhishek n said:   2 years ago
Can we skip particular numbers in declaring number ie, for example after var1=5 can we make it to write var2=10?

Please explain me.

Rohan said:   5 years ago
How? Please explain me.

Naina said:   6 years ago
In 1, int char & float. All are premitive data type. Then why the answer is not both 1&2?

Satish said:   7 years ago
What is the structures and union?

Can I get clear explanation about that.

Vidya said:   7 years ago
The struct and enum are the user defined data types but long int is predefined datatype (primary datatype), struct can have related datatypes, and enum which has name and value pair.

Abhi said:   8 years ago
In 1, which is user-defined the data type.

Varshitha said:   8 years ago
What is the difference between user defined and derived datatypes?

Can you tell me what is void data type?

Snehal said:   9 years ago
As you said int and float are not user defined data types then why answer 1, 2 is wrong?

Chandini agrawal said:   9 years ago
We can't declare a variable as a digit. Then how is it correct to write int 1 = 2.35?

Sachin10'R said:   9 years ago
What is difference between typedef and enum?

Post your comments here:

Your comments will be displayed after verification.