Write a program that reads a string and then prints a string that capitalizes every other letter in the string.
Answers
Answered by
0
Explanation:
I have done using C Programming
int main()
{
char input[100];
int i;
printf("Enter the string: ");
scanf("%s", &input);
for(i=0; input[i]!='\0'; i++)
{
if(input[i]>='a' && input[i]<='z')
{
input[i] = input[i] - 32;
}
}
printf("Uppercase output: %s",input);
return 0;
}
The above program gets the input from the user. Then each character is analyzed in the for loop. If the character falls under the small letter ASCII, then, it converted to capital letter using input[i] = input[i]-32.
Similar questions