EmSAT Achieve Exam  >  EmSAT Achieve Questions  >  Which of the following is not a primitive dat... Start Learning for Free
Which of the following is not a primitive data type in C++?
  • a)
    int
  • b)
    string
  • c)
    float
  • d)
    char
Correct answer is option 'B'. Can you explain this answer?
Most Upvoted Answer
Which of the following is not a primitive data type in C++?a)intb)stri...
The primitive data types in C++ are int, float, char, etc. However, string is not a primitive data type but a standard library class.
Free Test
Community Answer
Which of the following is not a primitive data type in C++?a)intb)stri...
Explanation:
In C programming language, data types are divided into two categories: primitive data types and derived data types. Primitive data types are the basic building blocks of a program, while derived data types are created by combining primitive data types or other derived data types.

Primitive data types in C:
1. int: It is used to store integer values, both positive and negative, within a certain range. The size of an integer depends on the compiler and the system architecture.

2. float: It is used to store decimal values (floating-point numbers) with single precision. The size of a float is typically 4 bytes.

3. char: It is used to store a single character. It can also be used to represent small integers within a certain range. The size of a char is typically 1 byte.

Derived data types in C:
1. Array: It is a collection of elements of the same data type. It can hold multiple values of the same data type.

2. Structure: It is a user-defined data type that allows you to combine multiple variables of different data types into a single entity.

3. Union: It is similar to a structure but it can only hold one value at a time. All variables in a union share the same memory location.

4. Enum: It is a user-defined data type that allows you to define a set of named values. Each named value is assigned a unique integer value.

Answer:
The correct answer is option B - string.
In C, string is not a primitive data type. It is a derived data type that is created by combining an array of characters. A string is represented as a sequence of characters terminated by a null character ('\0'). To work with strings in C, you need to use character arrays and perform operations using string manipulation functions.

Summary:
In C programming, the primitive data types are int, float, and char. String is not a primitive data type in C, but a derived data type created by combining an array of characters.
Attention EmSAT Achieve Students!
To make sure you are not studying endlessly, EduRev has designed EmSAT Achieve study material, with Structured Courses, Videos, & Test Series. Plus get personalized analysis, doubt solving and improvement plans to achieve a great score in EmSAT Achieve.
Explore Courses for EmSAT Achieve exam

Top Courses for EmSAT Achieve

Which of the following is not a primitive data type in C++?a)intb)stringc)floatd)charCorrect answer is option 'B'. Can you explain this answer?
Question Description
Which of the following is not a primitive data type in C++?a)intb)stringc)floatd)charCorrect answer is option 'B'. Can you explain this answer? for EmSAT Achieve 2024 is part of EmSAT Achieve preparation. The Question and answers have been prepared according to the EmSAT Achieve exam syllabus. Information about Which of the following is not a primitive data type in C++?a)intb)stringc)floatd)charCorrect answer is option 'B'. Can you explain this answer? covers all topics & solutions for EmSAT Achieve 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Which of the following is not a primitive data type in C++?a)intb)stringc)floatd)charCorrect answer is option 'B'. Can you explain this answer?.
Solutions for Which of the following is not a primitive data type in C++?a)intb)stringc)floatd)charCorrect answer is option 'B'. Can you explain this answer? in English & in Hindi are available as part of our courses for EmSAT Achieve. Download more important topics, notes, lectures and mock test series for EmSAT Achieve Exam by signing up for free.
Here you can find the meaning of Which of the following is not a primitive data type in C++?a)intb)stringc)floatd)charCorrect answer is option 'B'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Which of the following is not a primitive data type in C++?a)intb)stringc)floatd)charCorrect answer is option 'B'. Can you explain this answer?, a detailed solution for Which of the following is not a primitive data type in C++?a)intb)stringc)floatd)charCorrect answer is option 'B'. Can you explain this answer? has been provided alongside types of Which of the following is not a primitive data type in C++?a)intb)stringc)floatd)charCorrect answer is option 'B'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Which of the following is not a primitive data type in C++?a)intb)stringc)floatd)charCorrect answer is option 'B'. Can you explain this answer? tests, examples and also practice EmSAT Achieve tests.
Explore Courses for EmSAT Achieve exam

Top Courses for EmSAT Achieve

Explore Courses

Suggested Free Tests

Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev