Reverse a string without using built in function/strrev() - My articles - Publisher - Information Technology
Sunday, 2016-12-04, 5:13 PM
ebooks Programming Computer Science
Welcome Guest | RSS
Site menu
Section categories
My articles [23]
Main » Articles » My articles

Reverse a string without using built in function/strrev()
#include<stdio.h>
#include<string.h>
#define maxchar 10

void reverse(char []);

int main()
{
char line[maxchar];
printf("Enter line: ");
gets(line);
reverse(line);

return 0;
}

void reverse(char rev[])
{
int i=0;
    
printf("Reverse order: ");
for(i=strlen(rev);i>=0;--i)
printf("%c",rev[i]);
printf("\n");
}
Category: My articles | Added by: Sumrat (2012-02-22)
Views: 936 | Comments: 1 | Rating: 0.0/0
Total comments: 1
1  
cool

Name *:
Email *:
Code *:
Our poll
Rate my site
Total of answers: 152
Statistics

Total online: 1
Guests: 1
Users: 0
Login form