How to determines whether a character is a uppercase in C++

1 Answer

0 votes
#include <iostream>

using namespace std;

int main()
{
	
	char ch = 'A';
	if (isupper(ch))
		cout << "yes" << endl;
	else
		cout << "no" << endl;

	ch = 'a';
	if (isupper(ch))
		cout << "yes" << endl;
	else
		cout << "no" << endl;

	return 0;
}


/*
run:

yes
no

*/

 



answered Dec 7, 2016 by avibootz

Related questions

1 answer 199 views
1 answer 172 views
1 answer 154 views
1 answer 181 views
1 answer 214 views
1 answer 186 views
...