C: printing long double using printf
If you want to use very large floating numbers in C beyond what can be stored using double, use long double.This is useful for large scale scientific computations Printing a long double is shown here The output of this program As you may have noticed, the size of a long double is 12 bytes. There [...]
C: printing double using printf
If you want to use large floating numbers in C, you can use double instead of float. Printing a double is shown here The output of this program The size of a double is 8 bytes. There are three ways by which we printed the double lf corresponding to long float (double) g e: with [...]
C: Printing float using printf
float in C is used to represent floating point numbers. It’s declaration is as simple as The following program shows how to print a float. Let’s check the output The output is upto a precision of 6 digits after the decimal point. This is a behavior by default which can be changed
C: Printing unsigned/signed long long int using printf
If you want to use large integer numbers which cannot be represented using 4 bytes, you can use long long int instead of int. A long long int occupies 8 bytes. But you can make use of the sizeof operator to find the size of a long long int. Two types of integer are supported [...]
C: Printing unsigned/signed long int using printf
If you want to use integer which occupies 4 bytes, you can use long instead of int. Note that such a case is useful in cases where your compiler supports only 2 bytes int. In case of gcc compilers and a normal x86 machine, both int and long int occupy 4 bytes. Two types of [...]
C: Printing unsigned/signed short using printf
Two types of integer are supported in C: signed and unsigned integers. If you want to use integer which occupies only 2 bytes, you can use short instead of int. To declare a signed short integer To declare a unsigned short integer If you do not specify a specifier with short, it is taken as [...]
C: Printing unsigned/signed integer using printf
Two types of integer are supported in C: signed and unsigned integers. To declare a signed integer To declare a unsigned integer If you do not specify a specifier with int, it is taken as signed integer. To print signed integer, you can either use i or d. For unsigned integer, use u. This is [...]