Pages

Subscribe:

Blogger templates

Friday, March 9, 2012

Replacing space by a character " * "

The coding starts from next line:-
---------------------------------------------------------------------------------------------------------------
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<string.h>
void main()
{
clrscr();
char ch,name[20];
int i,l;
cout<<"\nEnter a String:";
gets(name);
l=strlen(name);

for(i=0;i<=l;i++)
{
if(name[i]==' ')
{
name[i]='*';
}
}
cout<<"\n "<<name;
getch();
}





0 comments:

Post a Comment