Advertisement
PIBogdanov

zad10

Nov 8th, 2023
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.92 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <limits.h>
  3.  
  4. int main()
  5. {
  6.     int charMin;
  7.     printf("Enter the min value of the char data type: ");
  8.     scanf("%d", &charMin);
  9.    
  10.     while (charMin != CHAR_MIN)
  11.     {
  12.         printf("This isn't the correct value!\n");
  13.        
  14.         scanf("%d", &charMin);
  15.     }
  16.    
  17.     int charMax;
  18.     printf("Enter the max value of the char data type: ");
  19.     scanf("%d", &charMax);
  20.    
  21.     while (charMin != CHAR_MAX)
  22.     {
  23.         printf("This isn't the correct value!\n");
  24.        
  25.         scanf("%d", &charMin);
  26.     }
  27.    
  28.     int intMin;
  29.     printf("Enter the min value of the int data type: ");
  30.     scanf("%d", &intMin);
  31.    
  32.     while (intMin != INT_MIN)
  33.     {
  34.         printf("This isn't the correct value!\n");
  35.        
  36.         scanf("%d", &intMin);
  37.     }
  38.    
  39.     int intMax;
  40.     printf("Enter the max value of the int data type: ");
  41.     scanf("%d", &intMax);
  42.    
  43.     while (intMax != INT_MAX)
  44.     {
  45.         printf("This isn't the correct value!\n");
  46.        
  47.         scanf("%d", &intMax);
  48.     }
  49.    
  50.     int unsignedCharMin;
  51.     printf("Enter the min value of the unsigned char data type: ");
  52.     scanf("%d", &unsignedCharMin);
  53.    
  54.     while (unsignedCharMin != 0)
  55.     {
  56.         printf("This isn't the correct value!\n");
  57.        
  58.         scanf("%d", &unsignedCharMin);
  59.     }
  60.    
  61.     int unsignedCharMax;
  62.     printf("Enter the max value of the unsigned char data type: ");
  63.     scanf("%d", &unsignedCharMin);
  64.    
  65.     while (unsignedCharMin != UCHAR_MAX)
  66.     {
  67.         printf("This isn't the correct value!\n");
  68.        
  69.         scanf("%d", &unsignedCharMax);
  70.     }
  71.    
  72.     unsigned int unsignedIntMin;
  73.     printf("Enter the min value of the unsigned int data type: ");
  74.     scanf("%u", &unsignedIntMin);
  75.    
  76.     while (unsignedIntMin != 0)
  77.     {
  78.         printf("This isn't the correct value!\n");
  79.        
  80.         scanf("%u", &unsignedIntMin);
  81.     }
  82.    
  83.     unsigned int unsignedIntMax;
  84.     printf("Enter the max value of the unsigned int data type: ");
  85.     scanf("%u", &unsignedIntMax);
  86.    
  87.     while (unsignedIntMax != UINT_MAX)
  88.     {
  89.         printf("This isn't the correct value!\n");
  90.        
  91.         scanf("%u", &unsignedIntMax);
  92.     }
  93.    
  94.     return 0;
  95. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement