Computer Science, asked by faheemahmed154, 8 months ago

Write a program that takes a character (number or string) in a variable & checks whether the given input is a number, uppercase letter or lower case letter in javascript

Answers

Answered by Anonymous
0

Answer:

// C++ implementation of the above approach

#include<bits/stdc++.h>

using namespace std;

void check(char ch)

{

if (ch >= 'A' && ch <= 'Z')

cout<< ch << " is an UpperCase character\n";

else if (ch >= 'a' && ch <= 'z')

cout<< ch << " is an LowerCase character\n";

else

cout<< ch << " is not an aplhabetic character\n";

}

// Driver Code

int main()

{

char ch;

// Get the character

ch = 'A';

// Check the character

check(ch);

// Get the character

ch = 'a';

// Check the character

check(ch);

// Get the character

ch = '0';

// Check the character

check(ch);

return 0;

}

Similar questions