Answers for "c sort alphabatics"

C
0

c sort alphabatics

#include<bits/stdc++.h>
using namespace std;
void  solution_function(){
//make modifications in the code below for accepting input from console /
    string str;
     getline(cin,str);
    for(int i=0;str[i] !='\0';i++)
    {
        if(isalpha(str[i]))
        {
            if(islower(str[i]))
                str[i] = toupper(str[i]);
            else
                str[i] = tolower(str[i]);
        }
    }
    cout<<str;
	}
	int main(){
	solution_function();

}
Posted by: Guest on August-07-2021

Code answers related to "C"

Browse Popular Code Answers by Language