fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main() {
  5. char s[100];
  6. int i;
  7. printf("\nEnter a string : ");
  8. gets(s);
  9.  
  10. for (i = 0; s[i]!='\0'; i++) {
  11. if(s[i] >= 'a' && s[i] <= 'z') {
  12. s[i] = s[i] - 32;
  13. }
  14. }
  15. printf("\nString in Upper Case = %s", s);
  16. return 0;
  17. }
Success #stdin #stdout 0s 5396KB
stdin
hello
stdout
Enter a string : 
String in Upper Case = HELLO