What is a programming language?
What is c programming?
C is a high- level language and general-purpose programming language that is ideal for developing portable applications.
Data type:
Variables:
A variable is contained which stores values.
int a = 3.
Constant:
It is a value of a variable that can't be changed in the program.
Ex: 10,20, a, etc.
Keywords:
Keywords are the parts of syntax, and they can't be used as an identifier.
For ex: int a= 10
Int is a keyword.
There are 32 keywords in c.
auto break
case char
const continue
default double
enum extern
float for
goto if
int long
register short
signed size of
static struct
switch type of
union unsigned
void volatile
while return
else
TYPES OF C CONSTANT:
There are four types of constant
1) Integer constant : This data type is used to define an integer number
(...-3,-2,-1 ,0,1,2,3…)
A single integer occupied 2 byte
%d is printing integer value
2) Real constant : There are two forms
Float: It is a single precision ,occupies 4 bytes
For ex 32.75
%f is printing float
Double: it is a double precision, occupies 8 bytes
For ex 32.7543
%lf for printing double
3) Char constant :It is used to define character, occupies 1 bytes
For ex - ‘A’
%c for printing character value
4) String :Set of character
For ex - sanu.
%s for printing string