A PROGRAM TO CONVERT STRING INTO Lower Case in C C++ Code Example
Write a c C++ program to convert the string from lower case to upper case using Loops ANSI
Write a c C++ program to convert the string from lower case to upper case using Loops ANSI
/* =========================================================================
A PROGRAM TO CONVERT STRING INTO
[LOWER CASE]
=========================================================================== */
#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<ctype.h>
void main(void)
{
char ch, string[80];
int length, index;
do
{
clrscr();
puts("ENTER THE STRING");
gets(string);
length=strlen(string);
for(index=0;index<length;index++)
{
/////////////////////////////////////////////////////////////////////////////
if((string[index] >='A')&&(string[index]<='Z')) // LOWER CASE CHECK
string[index]=_tolower(string[index]); // FUNCTION TO CONVERT
// STRING TO LOWER CASE
////////////////////////////////////////////////////////////////////////////
}
puts(string);
printf(" \n [PRESS '-' TO EXIT & '+' TO CONTINUE]\t");
ch= getche();
} while((ch!='-'));
getch();
}
0 comments:
Post a Comment