fork download
  1. #include<stdio.h>
  2.  
  3. int main() {
  4. int upper = 0, lower = 0;
  5. char ch[80];
  6. int i;
  7.  
  8. printf("\nEnter The String : ");
  9. gets(ch);
  10.  
  11. i = 0;
  12. while (ch[i] != '') {
  13. if (ch[i] >= 'A' && ch[i] <= 'Z')
  14. upper++;
  15. if (ch[i] >= 'a' && ch[i] <= 'z')
  16. lower++;
  17. i++;
  18. }
  19.  
  20. printf("\nUppercase Letters : %d", upper);
  21. printf("\nLowercase Letters : %d", lower);
  22.  
  23. return (0);
  24. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:9:2: warning: implicit declaration of function ‘gets’ [-Wimplicit-function-declaration]
  gets(ch);
  ^~~~
prog.c:12:18: error: empty character constant
  while (ch[i] != '') {
                  ^~
prog.c:13:1: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
 if (ch[i] >= 'A' && ch[i] <= 'Z')
 ^~
prog.c:15:2: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’
  if (ch[i] >= 'a' && ch[i] <= 'z')
  ^~
stdout
Standard output is empty