The Guide To Keywords In C – Learn Constants in C

The Comprehensive Guide To Constants In C

C Character Set:

    • A character denotes any alphabet, digit or special symbol used to represent numbers and special characters allowed in C.
    • Alphabets: A B C,….. Z a,b,c……z
    • Numeric Digits:0,1,2,3,4,5,6,7,8,9

Special Characters:

[su_table responsive=”yes” fixed=”yes”]
+ * / = %
& # ! ? ^
~ \ | < >
( ) [ ] { }
: ; . ,
[/su_table]

 

Constants in C:

  • Constants represent fixed values. That means their value will not change in the program.

Constants in C

Integer Constants:

  • An integer constant must have at least one digit.
  • It must not have any decimal point.
EX:50
  +890
  -9609

Real Constants:

  • Real constants are often called Floating-point constants.
  • Real constants must have at least one digit.
  • It must have a decimal point.
  • It could be either positive or negative.
EX:+564.98
890.0

-65.987
+3.2e-5

Character Constants:

  • A character constant is a single alphabet, a single digit or a single special symbol.
EX:'N'
'S'

'Navtutorials'

Keywords in C:

  • Keywords cannot be used as variables.
[su_table responsive=”yes” fixed=”yes”]
auto double int struct break else long
switch case enum register typedef extern return
union const float sizeof unsigned continue for
goto signed volatile do if static while
[/su_table]

Identifiers In C:

  • The first character must be an alphabet or underscore.
  • Must consist of only letters, digits or underscore.
  • It cannot be used as a keyword.
  • Must not contain white space

Variables in C:

  • Variable is a data name that may be used to store a data value.
  • Variable may take different values at different times during execution.
EX: counter
avg
total
Invalid: 985
*

 

naveed08st
 

Click Here to Leave a Comment Below 0 comments

Leave a Reply: