prev


Character Arrays - String manipulations:

83.Convert string from upper to lowercase (13.05.2010)

/*
Program# 83
date : 28-12-2008
Convert uppercase to lowercase
*/

#include <stdio.h>
main(){
char a[100],b[100];
int i;

i=0;
scanf("%c",&a[i]);
while(a[i]!='$'){
i++;
scanf("%c",&a[i]);
}
a[i]='\0';

i=0;
while(a[i]!='\0'){
if(a[i]>=65 && a[i]<=90)
b[i]=a[i]+32;
else
b[i]=a[i];
i++;
}
b[i]='\0';
printf("\n %s\n %s",a,b);
}



next
blog comments powered by Disqus