Wednesday, March 13, 2013

C Language Example # 37 Convert sting to upper case without using toupper function

C Language Example # 37 Convert sting to upper case without using toupper function.

* Program will convert string to upper case without using toupper function.

//Written by : Latest Technology Guide
//Title : C Language Example # 37 Convert sting to upper case without using toupper function.

#include <stdio.h>
#include <conio.h>
#include <string.h>
void main()
{
clrscr();
int i;
char ch[30];

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


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

i=0;
do
{
if(ch[i]>=97)
putchar(ch[i]-32);
else //if(ch[i]>=65 || ch[i]>=90)
{
putchar(ch[i]);
// printf("%c",ch[i]);
}
i++;
}while(ch[i]!=NULL);

getch();
}


Output:



--------------------------------------------------------------------------------
Explanation of C Programming Language Example # 37 Convert sting to upper case without using toupper function.

* You need to enter string in lower letters.
* Then program will convert string into upper letter without using toupper function.


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:

  1. thank you for sharing nice article in your blog
    visit
    web tutorial programming
    https://www.welookups.com

    ReplyDelete