Saturday 12 March, 2011

Write a function to upper the string

#include<stdio.h>
#include<conio.h>
void reverse(char[]);
int main()
{
char str[20];
clrscr();
printf("Enter string : ");
gets(str);
reverse(str);
getch();
return 0;
}
void reverse(char str[20])
{
int i;
printf("%s in reverse order is ",str);
for(i=strlen(str)-1;i>=0;i--)
printf("%c",str[i]);
}
Output:
Enter string : radhe
radhe in reverse order is ehdar

No comments:

Post a Comment