Hello , welcome to our website Quick Tech Expert in this article i tells about Variables , Constants , Keywords In C Program Language And Also How To Declare Variables And Constants In C Program Language , So if you like my article Please give feedback for Our Website by feedback corner below , And If Any Queries Please Comment On My Article By Which I Can Satisfy You .
Constants , Variables And Keywords In C Program Language .
The Alphabets , Digits , And Special Symbols When Properly combined from Constants , Variables , Keywords . A Constant Is That Entity Which Value Does Not Change During Program Execution Whereas A Variable Is That Entity Which Value Be Changed Or Changeable During Program Execution And Keywords Are That Words Which Carries Some Special Meaning And That Words Are Already Declared Or Defined In Programming Language That Are Called Keywords .
In Programming language , constants are also called Literals , And Variables are called Identifiers .
C Constants :
as also we reads that constants are that entity which which value does not change during program execution means we can not change the value of constants , constants are not Changeable ahead . According to this definition we also understands that what is constants so now we read about how to declare constants in c program language , so lets get started .....
How To declare constants in c program language :
now , we also understands that what is constants so lets begin how to declare constants in c program language . For integer value int data type is also used , for float value means decimal value float data type is also used , for character value char data type is also used .
There are three types of constants are in c program language .
integer constants
real constants
character constants
first we understands that How to declare integer constants in c program language .
How to declare integer constants in c program language .
- an integer constants are that constants which contains at least one numerical digit , so it is very important for integer constants must contains at least one numerical digit .
- as we know that integer means numbers without any decimal points so that concept is also here means any integer constants never contains a decimal point .
- the most important things about integer constants are that is its value could be zero , positive , negative , so always use signs for further asumption .
- the allowable range for integer constants -2147483648 to +2147483647 but i asks you trully that all the ranges of integer constants are depends on the compiler like Visual Studio Code , GCC range is -2147483648 to +2147483648but for turbo c/c++ range is -32768 to +32767 ,
- ex. 426 , +728 , -6763655653 , 0 etc
How to declare real constants in c program language .
- real constants are that constants which are often floating decimal point constants . real constants could be written in decimal points .
- as we know that real constants are floating decimal points so it is necessary for containing a decimal point .
- the most important things about real constants are that is its value could be zero , positive , negative , but in the real constants default sign is positive for further asumption .
- Comma , blanks are not allowed by real constants .
- ex +32.5 , 424442.000 , -33333.886786 etc
how to declare character constants in c program language .
- a character constants is a single Alphabets , digits , or special symbols which was enclosed within single inverted commas .
- ex 'a','5','='etc
c variables :
a particular type of variable can store only the same type of constants , that means variable stores the value of constants or other constants an integer variable can store only an integer constant , a real variable can store real constants that means that variable only store that type of constants and also character variables can stores only character constants , it can never be stored other constants are stored by other variables . in any c program many calculations are done , the results of these calculations are stored in some cells of computers memory . To make the retrievels and usage of these values are easy .
How To Declare Variables In C Program Language :
- a variable name is any combination of alphabets , digits , or underscores . some compilers allows more and more and could be up to 247 characters
- the first character in the variable name must be an alphabet or underscores
- ex int Quick , char tech , float expert etc
c Keywords :
keywords are the words whose meaning has already been explained to the c compilerthat means those special words which are already known the tasks be done by compiler means that words which are predefined for compiler to complete the tasks. Note : the keywords should not be used as variable names , because if we use keywords as variables it works as compiler and it does not allowed by compiler to use keywords as compiler .
auto , break , case , char , const , continue , default , do , double , else , if , enum , extern , float , for , goto , int , long , register , return , short , signed , sizeof , static , struct , switch , typedef , union , unsigned , void , volatile , while
These Are The 32 Keywords Which Are Already Defined In The C Library .
0 Comments