Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <limits.h>
- int main()
- {
- int charMin;
- printf("Enter the min value of the char data type: ");
- scanf("%d", &charMin);
- while (charMin != CHAR_MIN)
- {
- printf("This isn't the correct value!\n");
- scanf("%d", &charMin);
- }
- int charMax;
- printf("Enter the max value of the char data type: ");
- scanf("%d", &charMax);
- while (charMin != CHAR_MAX)
- {
- printf("This isn't the correct value!\n");
- scanf("%d", &charMin);
- }
- int intMin;
- printf("Enter the min value of the int data type: ");
- scanf("%d", &intMin);
- while (intMin != INT_MIN)
- {
- printf("This isn't the correct value!\n");
- scanf("%d", &intMin);
- }
- int intMax;
- printf("Enter the max value of the int data type: ");
- scanf("%d", &intMax);
- while (intMax != INT_MAX)
- {
- printf("This isn't the correct value!\n");
- scanf("%d", &intMax);
- }
- int unsignedCharMin;
- printf("Enter the min value of the unsigned char data type: ");
- scanf("%d", &unsignedCharMin);
- while (unsignedCharMin != 0)
- {
- printf("This isn't the correct value!\n");
- scanf("%d", &unsignedCharMin);
- }
- int unsignedCharMax;
- printf("Enter the max value of the unsigned char data type: ");
- scanf("%d", &unsignedCharMin);
- while (unsignedCharMin != UCHAR_MAX)
- {
- printf("This isn't the correct value!\n");
- scanf("%d", &unsignedCharMax);
- }
- unsigned int unsignedIntMin;
- printf("Enter the min value of the unsigned int data type: ");
- scanf("%u", &unsignedIntMin);
- while (unsignedIntMin != 0)
- {
- printf("This isn't the correct value!\n");
- scanf("%u", &unsignedIntMin);
- }
- unsigned int unsignedIntMax;
- printf("Enter the max value of the unsigned int data type: ");
- scanf("%u", &unsignedIntMax);
- while (unsignedIntMax != UINT_MAX)
- {
- printf("This isn't the correct value!\n");
- scanf("%u", &unsignedIntMax);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement