Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
Untitled
SUBMITTED BY:
Guest
DATE:
Aug. 27, 2014, 3:47 p.m.
FORMAT:
C++
SIZE:
657 Bytes
Raw
Download
Tweet
HITS:
23218
Go to comments
Report
#include
<stdio.h>
#include
<conio.h>
#include
<iostream.h>
#include
<string.h>
char
a
[
100
]
,
b
[
10
],
c
[
10
];
void
main
()
{
clrscr
();
cout
<<
"please enter a string : "
;
gets
(
a
);
cout
<<
"please enter a word to delete : "
;
gets
(
b
);
for
(
int
i
=
0
;
i
<
strlen
(
a
);
i
++
)
{
for
(
int
j
=
0
;
a
[
i
]
!=
' '
&&
a
[
i
]
!=
'\0'
;
i
++
,
j
++
)
c
[
j
]
=
a
[
i
];
c
[
j
]
=
'\0'
;
if
(
strcmp
(
c
,
b
)
==
0
)
for
(
int
h
=
0
;
h
<=
strlen
(
b
)
;
h
++
)
a
[
i
-
h
]
=
'\n'
;
}
cout
<<
endl
<<
"the new sentence is : "
;
for
(
int
u
=
0
;
u
<
strlen
(
a
);
u
++
)
if
(
a
[
u
]
!=
'\n'
)
cout
<<
a
[
u
];
getch
();
}
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus