answersLogoWhite

0


Best Answer

I'll just write a function to do that, I hope the good people won't try to run it as it is.... void function() { char c = 'a'; if( c >= 'a' && c <='z' ) System.out.println("LowerCase"); else if( c>='A' && c <='Z' ) System.out.println("UpperCase"); else System.out.println("Special Character"); }

User Avatar

Wiki User

15y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a program to initialize a character and print whether it is uppercase lowercase or special character in java module 1?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Java program to convert lowercase to uppercase?

You can use the toUpperCase() method on a String to convert any String to all uppercase.


Many languages distinguish between uppercase and lowecase letters in user-defined names what are the pros and cons of this design decision?

In computer programming, many languages distinguish between uppercase and lowercase letters in user defined variables. This is an advantage because it allows users to tell the difference between variables based on whether they are uppercase or not. It is a disadvantage because forgetting to change a letter to the proper case will result in an error when the program runs.


Can you initialize an object without constructor in java?

No. if you wish to create an object that you plan on using in a java program then the answer is NO. You cannot initialize an object of a Java class without calling the constructor.


Write a program that accepts a word in uppercase and prints it in lowercase?

There are two functions in ctype.h: toupper() and tolower(). First one to make character into upper case and the second one for making lower case.Here is a small program converting inputted character into lower case:#include #include int main() {char ch;printf("Enter the char: ");scanf("%c", &ch);printf("Char in lowercase: %c\n", tolower(ch));return 0;}Testing:Enter the char: GChar in lowercase: gEnter the char: SChar in lowercase: s


How would you write a program that counts the number of lowercase in a character?

I would use a loop like this: const char *p= str-1; size_t count= 0; while (*++p) if (islower (*p)) ++count;

Related questions

Java program to convert lowercase to uppercase?

You can use the toUpperCase() method on a String to convert any String to all uppercase.


Is uppercase ever used in a C program?

Yes. By convention, macros use all uppercase while all user-defined names should have a leading capital to differentiate them from standard library names which are all lowercase.


What is uppercase in computer?

For example, box is in lowercase while BOX is in uppercase. The term is a vestige of the days when typesetters kept capital letters in a box above the lowercase letters. A program that distinguishes between uppercase and lowercase is said to be case sensitive.


What setting on a computer or program might affect the sort order of electronic records?

There is a "Sort Option" in Word and Excel that would allow the program to sort by "Case sensitive" (UPPERCASE versus lowercase) criteria. Access ignores the "case" when sorting.


What does initialize mean?

The term "initialize" means to start, begin, or prepare. Often the word "initialize" is used in context with starting something such as a program or sequence.


How do you write a C program to input a string of lowercase alphabets and convert it to uppercase using a loop?

void to_uppercase (char* str) { if (str == 0) return; while (*str != '\0') { if (*str&gt;='a' &amp;&amp; *str&lt;='z') *str-=32; ++str; } }


Many languages distinguish between uppercase and lowecase letters in user-defined names what are the pros and cons of this design decision?

In computer programming, many languages distinguish between uppercase and lowercase letters in user defined variables. This is an advantage because it allows users to tell the difference between variables based on whether they are uppercase or not. It is a disadvantage because forgetting to change a letter to the proper case will result in an error when the program runs.


How long does it take a computer program to crack a five-character program?

It depends how the characters are encoded. If they are ANSI characters and limited to alphanumeric characters only (uppercase, lowercase and digits) then a 5 character password has (26+26+10)^5=916,132,832 permutations. Knowing the number of permutations and the speed of your computer (how many passwords you can generate and test every second) you should be able to work out how many hours it'll take. As an example, at 1,000 passwords per second it'd take 10.6 days using a 62 character alphabet.


What does initialized mean?

The term "initialize" means to start, begin, or prepare. Often the word "initialize" is used in context with starting something such as a program or sequence.


Can you initialize an object without constructor in java?

No. if you wish to create an object that you plan on using in a java program then the answer is NO. You cannot initialize an object of a Java class without calling the constructor.


Write a program that accepts a word in uppercase and prints it in lowercase?

There are two functions in ctype.h: toupper() and tolower(). First one to make character into upper case and the second one for making lower case.Here is a small program converting inputted character into lower case:#include #include int main() {char ch;printf("Enter the char: ");scanf("%c", &ch);printf("Char in lowercase: %c\n", tolower(ch));return 0;}Testing:Enter the char: GChar in lowercase: gEnter the char: SChar in lowercase: s


How would you write a program that counts the number of lowercase in a character?

I would use a loop like this: const char *p= str-1; size_t count= 0; while (*++p) if (islower (*p)) ++count;