C program to reverse a string without using any string functions-asr


#include <stdio.h>
#include <conio.h>
void main()
{
char *s;
int len,i=0;
clrscr();
printf("\nENTER A STRING: ");
gets(s);

while(1){
if(s[i]=='\0'){
len=i;
break;
}          i++;
}

       for(i=len;i>=0;i--){
printf("%c",*(s+i));
       }

getch();
}

Comments

Popular posts from this blog

aaabb to32 ,aabbb to a2b3 convert in c-asr

a2b3 output aabbb c program and beautiful use of getchar() ,isdigit() ,atoi() functions and stdlib.h header file-asr

C program to print square spiral number pattern - asr