Language: C++

#include<iostream>
#include<cctype>
#include<cstdio>
using namespace std;

int main(){
    int i = 0;
    char ch[1200];
    while(i < 1200){

        scanf("%c", &ch[i]);
        if(ch[i] == '\n'){
            break;
        } else if(isalpha(ch)){
            if (islower(ch[i])){
                ch[i] = toupper(ch);
            
            }else if(isupper(ch[i])){
                ch[i] = tolower(ch);
            }
        }
         printf("%c", ch[i])
        i += 1;
    }
 
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:26: error: no matching function for call to 'isalpha(char [1200])'
   14 |         } else if(isalpha(ch)){
      |                   ~~~~~~~^~~~
In file included from /usr/include/c++/14/cctype:42,
                 from /usr/include/c++/14/bits/localefwd.h:42,
                 from /usr/include/c++/14/ios:43,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/ctype.h:109:1: note: candidate: 'int isalpha(int)' (near match)
  109 | __exctype (isalpha);
      | ^~~~~~~~~
/usr/include/ctype.h:109:1: note:   conversion of argument 1 would be ill-formed:
a.cc:14:27: error: invalid conversion from 'char*' to 'int' [-fpermissive]
   14 |         } else if(isalpha(ch)){
      |                           ^~
      |                           |
      |                           char*
In file included from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46:
/usr/include/c++/14/bits/locale_facets.h:2643:5: note: candidate: 'template<class _CharT> bool std::isalpha(_CharT, const locale&)'
 2643 |     isalpha(_CharT __c, const locale& __loc)
      |     ^~~~~~~
/usr/include/c++/14/bits/locale_facets.h:2643:5: note:   candidate expects 2 arguments, 1 provided
a.cc:16:32: error: no matching function for call to 'toupper(char [1200])'
   16 |                 ch[i] = toupper(ch);
      |                         ~~~~~~~^~~~
/usr/include/ctype.h:125:12: note: candidate: 'int toupper(int)' (near match)
  125 | extern int toupper (int __c) __THROW;
      |            ^~~~~~~
/usr/include/ctype.h:125:12: note:   conversion of argument 1 would be ill-formed:
a.cc:16:33: error: invalid conversion from 'char*' to 'int' [-fpermissive]
   16 |                 ch[i] = toupper(ch);
      |                                 ^~
      |                                 |
      |                                 char*
/usr/include/c++/14/bits/locale_facets.h:2687:5: note: candidate: 'template<class _CharT> _CharT std::toupper(_CharT, const locale&)'
 2687 |     toupper(_CharT __c, const locale& __loc)
      |     ^~~~~~~
/usr/include/c++/14/bits/locale_facets.h:2687:5: note:   candidate expects 2 arguments, 1 provided
a.cc:19:32: error: no matching function for call to 'tolower(char [1200])'
   19 |                 ch[i] = tolower(ch);
      |                         ~~~~~~~^~~~
/usr/include/ctype.h:122:12: note: candidate: 'int tolower(int)' (near match)
  122 | extern int tolower (int __c) __THROW;
      |            ^~~~~~~
/usr/include/ctype.h:122:12: note:   conversion of argument 1 would be ill-formed:
a.cc:19:33: error: invalid conversion from 'char*' to 'int' [-fpermissive]
   19 |                 ch[i] = tolower(ch);
      |                                 ^~
      |                                 |
      |                                 char*
/usr/include/c++/14/bits/locale_facets.h:2693:5: note: candidate: 'template<class _CharT> _CharT std::tolower(_CharT, const locale&)'
 2693 |     tolower(_CharT __c, const locale& __loc)
      |     ^~~~~~~
/usr/include/c++/14/bits/locale_facets.h:2693:5: note:   candidate expects 2 arguments, 1 provided
a.cc:22:29: error: expected ';' before 'i'
   22 |          printf("%c", ch[i])
      |                             ^
      |                             ;
   23 |         i += 1;
      |         ~