fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <ctype.h>
  4.  
  5. int main(void)
  6. {
  7. printf("How many values?\n");
  8.  
  9. int amount;
  10. if (scanf("%d", &amount) == 1 && amount > 0)
  11. {
  12. printf("Please enter the values\n");
  13.  
  14. char ar[amount];
  15. int n = 0;
  16. for (; n<amount && scanf(" %c", ar+n) == 1; ++n)
  17. ar[n] = toupper((unsigned char)ar[n]);
  18.  
  19. for (int i=0; i<n; ++i)
  20. fputc(ar[i], stdout);
  21. fputc('\n', stdout);
  22. }
  23.  
  24. return 0;
  25. }
  26.  
Success #stdin #stdout 0s 9432KB
stdin
5
abc
de
stdout
How many values?
Please enter the values
ABCDE