Thursday, 2024-04-25, 5:30 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: 1466 | Comments: 1 | Rating: 0.0/0
Total comments: 1
1 Sumrat  
0
cool

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

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