#include
int main ()
{
printf ("The storage class for real numbers (float) is:% dn", sizeof (float));
printf ("The minimum positive real value is:% En", FLT_MIN);
printf ("The largest positive real value is:% En", FLT_MAX);
printf ("Accuracy:% dn", FLT_DIG);
return 0;
}
Compiling and running the above C program will result:
Storage class for real numbers (float) is: 4
The smallest positive real value is: 1.175494E-38
The largest positive real value is: 3.402823E + 38
Accuracy: 6
Void type defines no value. It is used in the following 3 cases:
Function returns void: There are many functions in C language that do not return any data and you can say that it is a void function. A function that does not return any value is of type void. For example: void exit (int status);
Function with void parameter: There are functions in C that do not accept any parameters. A function with no acceptable parameters is a void. Example: int rand (void);
Cursor to void: A pointer has type void * representing the object's address, not a type. Example memory allocation function void * malloc (size_t size); returning a void pointer can cast to any object.
You may not understand these points in terms of void, we should continue and in the next chapters, we will repeat these points.
According to Tutorialspoint
Previous article: Basic syntax of C programming
Next lesson: Turning in programming C