Last active
January 3, 2016 13:38
-
-
Save truh/8470395 to your computer and use it in GitHub Desktop.
/* Name of file : Datentypen_Klepp.c Author : Jakob Klepp Version : 20130927.1 Description : Ermitteln Sie die Grenzen der verfügbaren Basisdatentypen in C und geben Sie mittels der entsprechenden Formatierungszeichen Werte ein/aus! */
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <limits.h> | |
#include <float.h> | |
/* | |
Name of file : Datentypen_Klepp.c | |
Author : Jakob Klepp | |
Version : 20130927.1 | |
Description : Ermitteln Sie die Grenzen der verfügbaren Basisdatentypen | |
in C und geben Sie mittels der entsprechenden | |
Formatierungszeichen Werte ein/aus! | |
*/ | |
int main(int argc, char* argv[]) | |
{ | |
printf("+-----------------------------------+\n"); | |
printf("| Datentypen & Formatierungszeichen |\n"); | |
printf("+-----------------------------------+\n\n"); | |
/* * * * * * * * * * | |
* Integrale Typen * | |
* * * * * * * * * */ | |
printf("signed char\n"); | |
printf("MIN: %c, MAX: %c\n\n", SCHAR_MIN, SCHAR_MAX); | |
printf("unsigned char\n"); | |
printf("MIN: %c, MAX: %c\n\n", 0U, UCHAR_MAX); | |
printf("char\n"); | |
printf("MIN: %c, MAX: %c\n\n", CHAR_MIN, CHAR_MAX); | |
printf("short\n"); | |
printf("MIN: %d, MAX: %d\n\n", SHRT_MIN, SHRT_MAX); | |
printf("unsigned short\n"); | |
printf("MIN: %u, MAX: %u\n\n", 0U, USHRT_MAX); | |
printf("int\n"); | |
printf("MIN: %d, MAX: %d\n\n", INT_MIN, INT_MAX); | |
printf("unsigned int\n"); | |
printf("MIN: %u, MAX: %u\n\n", 0U, UINT_MAX); | |
printf("long int\n"); | |
printf("MIN: %ld, MAX: %ld\n\n", LONG_MIN, LONG_MAX); | |
printf("unsigned long int\n"); | |
printf("MIN: %lu, MAX: %lu\n\n", 0LU, ULONG_MAX); | |
printf("long long int\n"); | |
printf("MIN: %lld, MAX: %lld\n\n", LLONG_MIN, LLONG_MAX); | |
printf("unsigned long long int\n"); | |
printf("MIN: %llu, MAX: %llu\n\n", 0LLU, ULLONG_MAX); | |
/* * * * * * * * * * * | |
* Gleitkomma Typen * | |
* * * * * * * * * * */ | |
printf("float\n"); | |
printf("MIN: %f, MAX: %f\n\n", FLT_MIN, FLT_MAX); | |
printf("double\n"); | |
printf("MIN: %f, MAX: %f\n\n", DBL_MIN, DBL_MAX); | |
printf("long double\n"); | |
printf("MIN: %Lf, MAX: %Lf\n\n", LDBL_MIN, LDBL_MAX); | |
return EXIT_SUCCESS; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment