Fri Nov 07, 2008 5:23 pm
#include<stdio.h>
main()
{
char lett[80];
int convt,i=0;
convt='a'-'A';
printf("Enter the word in lowercase \n");
gets(lett);
for(i=0;(lett[i]>='a')&&(lett[i]<='z');i++)
{
if(lett[i]==' ')
printf("\t");
else lett[i]-=convt;
}
puts(lett);
}
#include<stdio.h>
main()
{
char str[80];
int i,delt='a'-'A';
printf("Enter a string less than 80 characters:\n");
gets(str);
i=0;
while(str[i])
{
if ((str[i]>='a')&&(str[i]<='z'))
str[i]-=delt;
++i;
}
printf("The entered string is (in uppercase):\n");
puts(str);
return 0;
}
Fri Nov 07, 2008 5:25 pm
Fri Jul 27, 2012 10:43 am
#include<stdio.h>
#include<conio.h>
void main()
{
char arr[80];
int diff,i;
clrscr();
diff='a'-'A';
printf("\nenter a string= ");
gets(arr);
//scanf("%s",arr);
for(i=0;arr[i]!='\0';i++)
{
if(arr[i]>='a' && arr[i]<='z')
arr[i]-= diff;
else if(arr[i]>='A' && arr[i]<='Z')
{}
else if(arr[i]==' ')
printf("\t");
else
{}
}
puts(arr);
//printf("\nthe upper case converted strins is =%s",arr);
getch();
}
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.