int main(){
string s; cin>>s;
int cnt1=1, cnt2=0;
for(int i=0;i<s.size();i++){
int code= (int)s[i];
if(code <=122 && code >=97 ){
code-=32;
}
cout<<char(code);
}
cout<<endl;
}
several mistakes :)
1) you didn't use code tags.
2) bits/stdc is nonstandard, try to avoid it
3) using namespace std is frowned upon, try to avoid it 4) cout << (char) code
its more readable to say 'a' than 97 or whatever the heck you are doing. you can still treat it like a number 'a' is a number.
(1) You haven't put your code in code tags (which is not helpful in the forum).
(2) Your include statement is non-standard.
(3) Most importantly ... you haven't actually said what you are trying to do!
At the moment your code ... correctly ... converts a single word into all upper case.
No doubt some will quibble about signedness and non-ASCII chars and the like, but, for the time being, just tell us what your intended outcome is and in what way your code doesn't meet it.