Print the characters of String with space
Get a String and Prints it characters with Space
Sample Input 1:
Hello
Sample Output 1:
H e l l o
Program or Solution
#include<stdio.h>
int main()
{
char str[50];
int i = 0;
fgets(str,50,stdin);
while(str[i]!='\0')
{
printf("%c ",str[i++]);
}
return 0;
}
Program Explanation
Get a String using fgets() function.
Str -> reads the string and stores it in str.
50 -> reads maximum of 50 characters stdin-> reads character from keyboard using for loop print all characters one by one.
"%c " in printf prints character with space.
Comments
Related Programs
- Find the Length of given String
- Find the location of given Character in a String
- Count the occurences of given Character in a String
- Covert Lowercase characters to Uppercase Characters
- Covert Uppercase characters to Lowercase Characters
- Count the number of vowels in given string
- Compare two Strings are equal
- Concate two given Strings
- Find the location of given sub string in a String
- Count the occurences of given substring in a String
- Reverse the given String
- Check the given string is Palindronme
- Remove the spaces in given String
- Remove the Vowels in given String
coming Soon
coming Soon