C Programming
Wednesday, 23 April 2014
23. Write a program to input a string and output the reversed string, i.e. if"USF" is input, the program has to output "FSU". You are not to use array notation to access the characters, instead please use pointer notation.
#
in
c
lu
d
e
<
s
td
i
o
.h
>
#
in
c
lu
d
e
<co
ni
o
.
h
>
m
a
i
n
(
)
{
c
h
a
r
*
s
tr
;
in
t
l
en,i
;
c
lr
s
c
r(
)
;
p
rin
t
f
(
"
e
n
t
e
r
t
h
e
s
t
ri
n
g
\n
"
)
;
g
e
t
s
(
st
r
)
;
len
=
s
t
r
l
en(
s
t
r)
;
fo
r(i
=
l
e
n
-1;
i
>=
0
;
i-
-
)
p
rin
t
f
(
"%c"
,
*
(
s
t
r
+
i))
;
g
e
t
c
h
()
;
re
t
u
r
n
0
;
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment