converting lower case into upper case.

                     Converting lower case into upper case



This blog consists of programme for converting lower case into upper case.It means all the small letters will convert into capital letter in a string.String is array of character.C language has inbuilt function for converting lower case into upper case.But this blog do the same without using inbuilt
function.


                   





                                     Following method has used inside the programme

  1. Take the string input from user.
  2. Perform iteration till the null value of input string.
  3. Apply the condition to check the lower case character.
  4. If the condition found then change it from lower case into upper case.


                                      Lower case into upper case



#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<string.h>
void main()
{
       clrscr();
       char str[30];
       int i,len=0;
       printf("Enter string\n");
       gets(str);
       len=strlen(str);
       for(i=0;i<len;i++)
       {
               if(str[i]>='a'||str[i]<='z')
               {
                      str[i]=str[i]-32;;
               }
       }
        printf("Now,string is %s",str);
        getch();
}


output is:
Enter string
Deepak
Now,string is DEEPAK



converting lower case into upper case. converting lower case into upper case. Reviewed by Deepak kumar soni on December 18, 2018 Rating: 5

No comments:

Powered by Blogger.