C-Programming
Write a program in c to convert text from uppercase to lowercase?? in easily
Write a program in c to convert text from uppercase to lowercase?? in easily
code:-
/* convert text from uppercase to lowercase.*/
#include<stdio.h>
#include<conio.h>
main()
{
char var[120];
int ch=0;
clrscr();
printf("\n enter the text:");
gets(var);
while (var[ch] != 0)
{
if ((var[ch]>='A')&&(var[ch]<='Z'))
{
var[ch]=var[ch]+32;
printf("%c",var[ch]);
}
else if ((var[ch]>='a')&&(var[ch]<='z'))
{
var[ch]=var[ch]-32;
printf("%c",var[ch]);
}
else if (var[ch]==' ')
{
printf(" ");
}
else
{
printf("\n this is not an alphabet.");
continue;
}
ch=ch+1;
}
getch();
}
DizIT_Operators
Thank-You
Write a program in c to convert text from uppercase to lowercase?? in easily
code:-
/* convert text from uppercase to lowercase.*/
#include<stdio.h>
#include<conio.h>
main()
{
char var[120];
int ch=0;
clrscr();
printf("\n enter the text:");
gets(var);
while (var[ch] != 0)
{
if ((var[ch]>='A')&&(var[ch]<='Z'))
{
var[ch]=var[ch]+32;
printf("%c",var[ch]);
}
else if ((var[ch]>='a')&&(var[ch]<='z'))
{
var[ch]=var[ch]-32;
printf("%c",var[ch]);
}
else if (var[ch]==' ')
{
printf(" ");
}
else
{
printf("\n this is not an alphabet.");
continue;
}
ch=ch+1;
}
getch();
}
DizIT_Operators
Thank-You
No comments:
Post a Comment