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.

Shan_mani said:   1 decade ago
Can you explain the enum operation?

Sony said:   1 decade ago
Could you say about enum data type.

Sirajmuneer said:   1 decade ago
We can store list of items in a single name called enum
compailer assign val1=0,val1=1 and so on
we can assign directly to the value of enum
second value is generally 51 and third is 52 and so on

Shriya said:   1 decade ago
Is not enum a user defined data type?

Roko said:   1 decade ago
How can we implement it to the programming?

Pankaj said:   1 decade ago
int main()
enum var {var1,var2,var3};
enum num {num1=5,num2,num3};
printf("%d %d %d \n",var1,var2,var3);
printf("%d %d %d",num1,num2,num3);
return 0;

Kavitha said:   1 decade ago
int float char also not a userdefiend data then why it comes answer is both 1 and 2

Padma said:   1 decade ago
Yes kavi but there is a user defined data type. It is not in it.

Thanvi said:   1 decade ago
What is the difference b/w primitive n nonprimitive data type?

Levin max said:   1 decade ago
Primitive data types are already predefined data types as such as int , float,double etc. whereas non primitive data types are created by d users as such as objects in java....

Post your comments here:

Your comments will be displayed after verification.