Wednesday, February 20, 2013

C Language Example # 20 String Example : Convert string from Upper to lower without function


C Language Example # 20 String Example : Convert string from Upper to lower without function.

* Lets now starts with String Header File concept.
* Example of C Language String : convert string from upper to lower without function.

//Written by Latest Technology Guide    
//Title : C Language Example # 20 String Example : Convert string from Upper to lower without function.
  
#include <stdio.h>
#include <conio.h>
#include <string.h>

void main()
{
clrscr();
int i;
char ch[30];

printf("\n Enter Upper Case Character : ");
gets(ch);

printf("\n ********** : Lower Case Character :**********\n\n");

i=0;
do
{
if(ch[i]>=65 && ch[i]<=90)
putchar(ch[i]+32);
else if(ch[i]==32)
putchar(ch[i]);
else
putchar(ch[i]);

i++;
}while(ch[i]!=NULL);

getch();

Output:
* You can convert string from upper to lower without function
Enter String for example : CPROGRAMMING

You will receive output : cprogramming
--------------------------------------------------------------------------------
Explanation of C Programming Language Example # 20 String Example : Convert string from Upper to lower without function.

* Enter String of your choice 
* You will find output as string in upper letter.

Note: All programs are developed and tested using Turbo C++ 3.0 under Windows XP. We just want to provide guidelines to the users. If you are using any other Compiler or other operating system they you need to modify this program as per your requirements. 

1 comment: