Answers for "alternate case in string c"

C
0

alternate case in string c

#include <stdio.h>
#include <ctype.h>

void main()
{
    char s[200];
    int i,count=0;

    printf("Enter  the string : ");
    gets(s);
	
    for(i=0;s[i]!='\0';i++)
    {
    	if(s[i]>=97 && s[i]<=122)
    	{
          s[i]=s[i] - 32;
		}

		else if(s[i]>=65 && s[i]<=90)
    	{
          s[i]=s[i] + 32;
		}
    }

	puts(s);
}
Posted by: Guest on June-23-2021

Code answers related to "C"

Browse Popular Code Answers by Language