You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
357 B
26 lines
357 B
/*
|
|
* pr_01.c
|
|
*
|
|
* Created on: Jun 9, 2013
|
|
* Author: delmadord
|
|
*/
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
#define N 100
|
|
|
|
int main(void) {
|
|
char ch, sentence[N], *p = sentence;
|
|
printf("Enter a message: ");
|
|
while ((ch = getchar()) != '\n' && p < sentence + N) {
|
|
*p++ = ch;
|
|
}
|
|
|
|
printf("Reversal is: ");
|
|
for (p--; p >= sentence; p--)
|
|
putchar(*p);
|
|
|
|
return 0;
|
|
}
|
|
|