Type Keyword
character data char
signed whole numbers int
floating-point numbers float
double- precision floating-point numbers double
valueless void
A variable of type char is 8 bits long and is most commonly used to hold a single character. Because C is very flexible, a variable of type char can also be used as a " little integer" if desired.
Integer variables (int) may hold signed whole numbers (numbers with no fractional part). For 16-bits long and is most commonly used to hold a single character.
Variables of types float and double hold signed floating-point values, which may have fractional components. One difference between float and double is that double providers about twice the precision as does float .
Shown a program use the variables:
#include <stdio.h>
int main (void)
{
char ch;
float f;
double d;
ch= 'X';
f=100.123;
d=123.009;
printf ("ch is %c,",ch);
printf("f is %f,",f);
printf("d is %f",d);
return o;
}
No comments:
Post a Comment