In a C like programming language, which of the following is not a correct built in variable type name for declaring a numeric or character variable?

Difficulty: Easy

Correct Answer: real

Explanation:


Introduction / Context:
In C and many C like languages, there are specific keywords used to declare variables of different types, such as integers, floating point numbers, and characters. Using the correct keyword names is important because the compiler only recognizes standard type names. This question asks which of the given type names is not a standard built in type name in a typical C style language.



Given Data / Assumptions:

  • We assume a language family that includes C, C plus plus, and similar syntaxes.
  • Standard primitive types include int, char, float, and double.
  • Some languages use the word real informally in teaching, but not as an actual keyword.
  • The question is about core built in type names, not user defined typedefs or aliases.


Concept / Approach:
C style languages reserve certain words as keywords. For numeric and character data, these include int for integers, char for single characters, float for single precision floating point numbers, and double for double precision floating point numbers. There is no standard built in keyword named real in C or C plus plus. While some other languages or development environments may offer real as a type, in the context of C style exam questions it is generally considered incorrect.



Step-by-Step Solution:
Step 1: List the standard primitive type names in C: int, char, float, double, and others like short and long. Step 2: Compare this list with the options. Types char, float, double, and int are clearly on the list of standard keywords. Step 3: The type real does not appear in the standard C keyword list. Step 4: Therefore, real must be the option that is not a correct built in type name in this context.


Verification / Alternative check:
If you try to compile a simple C program with a declaration like real x; the compiler will usually report an error saying that real is an unknown type name, unless you have defined it yourself using typedef. Declarations such as int x;, char c;, float f;, and double d; compile correctly because they use recognized keywords. This practical test confirms that real is not a standard built in type in C.



Why Other Options Are Wrong:
Option b, char, is a standard type for single characters. Option c, float, is the standard single precision floating point type. Option d, double, is the standard double precision floating point type. Option e, int, is the standard integer type. All of these are valid keywords that compilers understand without extra definitions.



Common Pitfalls:
Some textbooks or pseudocode examples use the word real to mean a general floating point number in algorithm descriptions. Students sometimes mistakenly assume that this is also the keyword in C, which leads to errors. Always distinguish between mathematical terminology and actual programming language keywords, and check a reference when in doubt.



Final Answer:
The type name that is not a standard built in type in a typical C style language is real, option a.

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion