C Constant

The alphabets , numbers and special symbols combined they form Constants.

We have two types of C Constants :-

Primary Constants

Secondary Constants

Primary Constants :->

Integer Constant, Real Constant, Character Constant.

Secondary Constants :->

Array, Pointer, Structure, Union, Enum etc.

Rules for C Constants :->

 

Integer C Constants :-

  • An integer constant should have at least one digit.
  • It can be positive or negative.
  • When no sign assign,its mean positive.
  • Commas are not allowed

 

Character C Constants :->

  • Character constant is a single aphabet,a single digit or single special symbol enclosed within single inverted commas. Both the inverted commas should point to the left.  Example  ‘B’ is a valid character constant where  ‘2B’ is not.

Real C Constants :-

  • Real constants are called floating Point Constants.
  • Reals constant are into two form fraction and Exponential form.
  • Normally they are positive.

Example : – +456.78

 

ANSI C Keywords :-

 

auto

break

case

char

const

continue

default

do
signed

sizeof

static

 

 

 

 

 

 

enum

extern

while

volatile

void

unsigned

struct

Switch
double

else

 

 

 

 

 

 

 

Float

For

goto

if

int

long

register

return

short

typedef

union

 

 

 

 

 

 

C Keywords are the words whose meaning has already been defined to the C compiler. The C Keywords can not be a variable names because it we do so, wee are trying to assign a new meaning to the Keyword, Which is now allowed by the computer.




Follow Us

Contact Us

tutorialworldin@yahoo.com

Back to Top