Tuesday, February 19, 2013

C Language Example # 19 String Example : Convert string from lower to upper without function

C Language Example # 19 String Example : Convert string from lower to upper without function.

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

//Written by Latest Technology Guide    
//Title : C Language Example # 19 String Example : Convert string from lower to upper without 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]);          //method 1 
// printf("%c",ch[i]);      //method 2
}
i++;
}while(ch[i]!=NULL);

getch();
}


Output:

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

You will receive output : CPROGRAMMING
--------------------------------------------------------------------------------
Explanation of C Programming Language Example # 19 String Example : Convert string from lower to upper 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:

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

    ReplyDelete