Keywords in c programming language
๐ฅ Keywords in C (In Detail)๐
๐ธ What are Keywords?
- Keywords are reserved words in C
- They have predefined meaning
- Cannot be used as variable names
- Written only in lowercase
๐ธ Total Keywords in C
- C has 32 keywords
๐ธ List of Keywords with Explanation
๐น Data Type Keywords
Keyword Meaning
- int Integer data type
- float Decimal (floating point) number
- double Double precision floating point
- char Single character
- void No value or empty
๐น Storage Class Keywords
Keyword Purpose
- auto Default storage class
- register Store variable in CPU register
- static Retains value between function calls
- extern Declares global variable
๐น Control Statement Keywords
Keyword Use
- if Conditional execution
- else Alternative condition
- switch Multiple condition selection
- case Part of switch
- default Executes if no case matches
๐น Looping Keywords
Keyword Use
- for Loop with initialization
- while Loop with condition
- do Loop executes at least once
- break Exit from loop
- continue Skip current iteration
๐น Function & Program Control
Keyword Meaning
- return Return value from function
- goto Jump to labeled statement
๐น Type Modifiers
Keyword Meaning
- short Smaller integer
- long Larger integer
- signed Allows negative values
- unsigned Only positive values
๐น User Defined Data Type Keywords
Keyword Use
- struct Structure
- union Union
- enum Enumeration
- typedef Create alias name
๐น Other Important Keywords
Keyword Meaning
- sizeof Size of data type
- const Value cannot be changed
- volatile Value can change anytime
๐ธ Example Using Keywords
C
int main()
{
static int a = 10;
if(a > 5)
return 0;
}
Comments
Post a Comment