In this example, I can provide a straightforward illustration related to variable types.
Integer Types: Integer types represent whole numbers and include int, short, long, and unsigned int.
Floating-Point Types: Floating-point types, such as float and double, are used for numbers with decimal points.
Character Type: The char type is used to store single characters, like letters or symbols.
Boolean Type: The _Bool type is used for Boolean values, typically representing true or false.
#include <stdio.h>
int main() {
// Integer Types
int integerNumber = 10;
short shortNumber = 5;
long longNumber = 1000;
unsigned int unsignedInteger = 20;
// Floating-Point Types
float floatingNumber = 3.14;
double doubleFloating = 2.71828;
// Characters
char character = 'A';
// Boolean Values
_Bool booleanValue = 1; // 1 represents true
// Printing Variables to the Console
printf("Integer: %d\n", integerNumber);
printf("Short: %hi\n", shortNumber);
printf("Long: %ld\n", longNumber);
printf("Unsigned Integer: %u\n", unsignedInteger);
printf("Floating-Point: %f\n", floatingNumber);
printf("Double Floating-Point: %lf\n", doubleFloating);
printf("Character: %c\n", character);
printf("Boolean Value: %d\n", booleanValue);
// Basic Mathematical Operations
int sum = integerNumber + shortNumber;
float product = floatingNumber * doubleFloating;
// Printing Operations to the Console
printf("Sum: %d\n", sum);
printf("Product: %f\n", product);
return 0;
}