answersLogoWhite

0


Best Answer

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: G

Char in lowercase: g

Enter the char: S

Char in lowercase: s

User Avatar

Wiki User

15y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

#include <ctype.h>

StringToUpper (char *psz) {

while (*psz != '\0') {

*psz = toupper (*psz);

psz++

}

}

StringToLower (char *psz) {

while (*psz != '\0') {

*psz = tolower (*psz);

psz++

}

}

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

This sounds like homework, and doing it all for you would not help you in the long run. But here are a few pointers.

  • Go trough all the individual characters in the string
  • Either check if the char code's numerical code is between 65 and 90 (which corresponds to the uppercase characters in the ascii table.. OR
  • use the Character.isUpperCase() method
  • If any chars are found that breaks with one of the two rules above, the word is not all upper case
  • All strings have a toLowerCase() method... "All YOUR bAsE".toLowerCase() will return the string "all your base"
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a program that accepts a word in uppercase and prints it in lowercase?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Create a program which accepts a number not less than 10The program prints the reverse of the number?

ten


What commands are used to prints text in java?

System.out.println("text"); or System.out.print("text"); Please note that Java is case sensitive, meaning you must match uppercase and lowercase exactly.


Write a program that read phrase and print the number of lower-case letter in it using function of counting?

write a program that reads a phrase and prints the number of lowercase latters in it using a function for counting? in C program


C program which accepts in order and preorder traversal outputs of a binary tree as input and prints the corresponding binary tree?

any body can help on this ?


How did menu's develop?

A restaurant prints it out using a special program


How do you write a c program that prints a box an oval an arrow and a diamond?

You first learn how to program in C.


Dry run table in flow-chart?

/* my second program in C++ with more comments */ #include &lt;iostream&gt; using namespace std; int main () { cout &lt;&lt; "Hello World! "; // prints Hello World! cout &lt;&lt; "I'm a C++ program"; // prints I'm a C++ program return 0; }


How do you identify the character in a string is uppercase?

In order to find whether a character in a string is in uppercase or not, you need to use the ascii\unicode values of the character. You may want to use the following code-- String str="Your Sample String Here"; //(say you have this string) int l=str.length(); for(int i=0;i&lt;l;i++) { char ch=str.charAt(i); if(ch&gt;=65&amp;&amp;ch&lt;=90) //Since the values of block letters in ASCII are from 65 to 90 System.out.println(ch); } //This program basically prints out the block letters, but you can modify it as you like, by changing the statement after 'if' as you want


Program in c to develop an algorithm that prints the n value of algorithm?

reymond rillera reymond rillera


Why MsgBox with string 000 prints e but 00 or 0000 are printed correctly Thank you ozcansyahoocom?

Your program is wrong.


Do a program with turbo pascal to print the alphabet backward?

Turbo Pascal is a style of computer programming. This type of writing language can be used to create a program that prints the alphabet backwards.


Write a program that input a positive integer and prints a triangle using for loop?

write a program that reads in the size of the side of square and then pints a hollow square of that size out of asterisks and blanks?