c sort alphabatics

Solutions on MaxInterview for c sort alphabatics by the best coders in the world

showing results for - "c sort alphabatics"
Lennart
25 Oct 2016
1#include<bits/stdc++.h>
2using namespace std;
3void  solution_function(){
4//make modifications in the code below for accepting input from console /
5    string str;
6     getline(cin,str);
7    for(int i=0;str[i] !='\0';i++)
8    {
9        if(isalpha(str[i]))
10        {
11            if(islower(str[i]))
12                str[i] = toupper(str[i]);
13            else
14                str[i] = tolower(str[i]);
15        }
16    }
17    cout<<str;
18	}
19	int main(){
20	solution_function();
21
22}
similar questions
queries leading to this page
c sort alphabatics