Generation

generate functionFri, 14 Apr 2023

write a code that supports strings and allows the user to select whether to view the string in upper or lower case

++ #include<iostream> using namespace std; int main() { char str[50]; int i; cout<<"Enter the string"; cin>>str; for(i=0;i<50;i++) { if(str[i]>=65&&str[i]<=90) { str[i]=str[i]+32; } else if(str[i]>=97&&str[i]<=122) { str[i]=str[i]-32; } } cout<<"\n"<<str; return 0; }

Questions about programming?Chat with your personal AI assistant