Write a program that reads a letter and prints it in lowercase if it was uppercase, or prints it in uppercase if it was lowercase.
Input : Input consists of a letter.
Output : Print a line with the given letter in lowercase if it was uppercase, or in uppercase if it was lowercase.
#include <iostream> using namespace std; int main () { char c, nueva; cin >> c; if (c>='a' and c<='z') nueva= c-32; else nueva = c+32; cout << nueva << endl; }
No comments:
Post a Comment