What are different data type in C

Interview Questions
  • What are different data type in C.
  • What are Tokens in C? what are the different Types of Tokens in C.
  • Can variable names in C have special symbols.
  • Can variable names in C start with underscore.

What are different data type in C

A data type in C programming language declares the type of data that a variable can store and how much memory is required to store this data. C Data types can be classified into four categories:

  • Basic Data types : There are four basic data types in C(int, char, float and double.)
  • Derived Data Type : Data types that are derived from fundamental data types are called derived data types(Array, Structures, Unions and Pointers).
  • Void Data Type : Void is an empty data type that has no associated value(void).
  • Enumerated Data Type : Enumeration data type consists of set of named constant values(enum).


What are Tokens in C? what are the different Types of Tokens in C.

Tokens are the fundamental building blocks of a C Program. Punctuations, characters, words, sequence of words(strings) everything are tokens. Here are the different types of tokens in C with example.

  • Constants : 3.14, 100
  • Keyword : for, switch, float
  • Identifier : getSum, totalAmount
  • String : "ABCD", "Jack"
  • Operators : +, -, /, *
  • Special Symbols : [], , ;


Can variable names in C have special symbols.

No, a variable's name can be composed of alphabets, digits, and underscore only.


Can variable names in C start with underscore.

Yes, the first character of a variable name must be either an alphabet or underscore.


Related Topics
What is the difference between Character, Integer, Float and Double data types.
What is the difference between auto variable and register variable in C
What is constant in C and Different Types of Constants.
What is the difference between constant and variable in C
What is local variable in C
What is the difference between & and * operators in C
What is the use of goto statement in C
What is NULL pointer in C.
What are the advantages of using Pointers in C.
Can array size be declared at run time.