C Program and Algorithm to convert one case to another using user defined function.

#include<stdio.h>
#include<conio.h>
char s[50];
void convert()
{
int i;
for(i=0;s[i]!='\0';i++)
{
if((s[i]>64)&&(s[i]<91))
s[i]+=32;
else if((s[i]>96)&&(s[i]<123))
s[i]-=32;

}
}
void main()
{
clrscr();
printf("\n Enter a string\t: ");
scanf("%[^\n]s",&s);
convert();
printf("\n\nAnother case is\t: %s",s);
getch();
}


Algorithm

convert()
step1:start
step2:intilize i<-0 p="">step3:check whether s[i] is not End of line,then go to step 4
else go to step 10
step4:check whether s[i]>64 and s[i]<91 5="" go="" p="" step="" then="" to=""> else go to step 6
step5:s[i]=s[i]+32
step6:check whether s[i]>96 and s[i]<123 7="" go="" p="" step="" then="" to=""> else go to step 8
step7:s[i]=s[i]-32
step8:i=i+1
step9:go to step 3
step10:stop
main ()
step1:start
step2:read s
step3:call convert()
step4:print s
step5:stop