STRING REVERSE.

                                 STRING REVERSE




#include<stdio.h>

#include<conio.h>

void main() 

{   

int i,a=0,n1; char s1[10];     

clrscr();

printf("Enter string");

scanf("%s",&s1);   

for(i=0;s1[i]!='\0';i++)       

a++;  

n1=a;     

printf("reverse of string is");         

for(i=n1;i>=0;i--)            

{                    

printf("%c",s1[i]);             

}             

printf("\n");      

getch();  

}

No comments:

Post a Comment

If you have any problems related to solutions or any concept please let me know.

Copyright (c) 2020 Custom Programs All Right Reserved

Pages