Dear members please help me in understanding the control flow in the following code, thanks
include <iostream>
class constructs
#include <iostream>
class constructs
{
char inp;
public:
void acceptCharacter()
{
cout<<"Enter a character: ";
cin>>inp;
if(inp>='A') //ASCII value of A = 65
if(intp<='Z') //ASCII value of Z = 90
cout<<endl<<"Uppercase";
else if (inp>='a') //ASCII value of a = 97
if(inp<='z') //ASCII value of z = 122
cout<<endl<<"Lowercase";
else
cout<<endl<<"Input character>z";
else
cout<<endl<<"Input character>Z but lessthan a";
else
cout<<endl<<"Input character less than A";
};
int main()
{
constructs c1;
c1.acceptCharacter();
return 0;
}
Suppose if I key in + whose ASCII value is 43 the last statement "Input character less than A" is displayed, my question is about the understanding of control flow, does it skips all the other if else??? please guide me... many thanks.