What are different data type in C

What are different data type in C

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.