Skip to content

ex1

← Back

Basic Info

Computer Programming 1
└── Lecture 13 LAB Exercises on Functions
    └── ex1.cpp

Preview

using namespace std;
#include <iostream>

bool checkLowercase(char);

int main(){
    char i;
    cout << "Please input a lowercase character: ";
    cin >> i;

    if (checkLowercase(i)){cout << "uppercase: " << char(i+('A'-'a')) << endl;}
    else {cout << "No lowercase detacted" << endl;}

    return 0;
}

bool checkLowercase(char i){return (i<='z' && i>='a');}