C Code 19 _ C Program to underline the given word
Program:
#include<stdio.h>
#include<string.h>
int main()
{
char c[100];
int l,i;
printf("* * * * Underline a word * * * *");
printf("\n\nEnter a word : ");
gets(c);
l=strlen(c);
printf("\n");
for(i=0;i<l;i++)
{
printf("%c",c[i]);
}
printf("\n");
for(i=0;i<l;i++)
{
if(c[i]==32)
{
printf(" ");
}
else
{
printf("~");
}
}
getch();
return 0;
}
Output:
Thank You ...