C Programming - Declarations and Initializations - Discussion
Discussion Forum : Declarations and Initializations - General Questions (Q.No. 7)
7.
Which of the following is not user defined data type?
1 : |
|
2 : |
|
3 : |
|
Answer: Option
Explanation:
C data types classification are
- Primary data types
- int
- char
- float
- double
- void
- 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.)
Discussion:
48 comments Page 3 of 5.
Vidya said:
9 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.
Satish said:
8 years ago
What is the structures and union?
Can I get clear explanation about that.
Can I get clear explanation about that.
Naina said:
7 years ago
In 1, int char & float. All are premitive data type. Then why the answer is not both 1&2?
Abhishek n said:
3 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.
Please explain me.
Laasya said:
1 decade ago
Can you explain me in detail the difference between structure, union and enum operations?
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
synatx:
enum(val1,val2,....valn);
compailer assign val1=0,val1=1 and so on
we can assign directly to the value of enum
val1=50,
second value is generally 51 and third is 52 and so on
synatx:
enum(val1,val2,....valn);
compailer assign val1=0,val1=1 and so on
we can assign directly to the value of enum
val1=50,
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
#include<stdio.h>
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;
}
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;
}
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers