hello friends....
TAKE THE FIRST STEP TO KNOWLEDGE FRIENDS BECAUSE KNOWLEDGE IS FREE.
>> /* REVERSE STRING PROGRAM BY USING POINTER IN C PROGRAMMING */
#include<stdio.h>
#include<conio.h>
void main()
{
char *s1; // s1 is pointer variable
int l,e,s;
// l=string length, e=string end, s=string start
clrscr();
printf("enter your string :");
gets(s1);
l=0;
while(*(s1+l)!='\0')
{
l++;
}
s = 0;
e = l-1;
while(s<e)
{
char t;
t = *(s1 + s);
*(s1+s)=*(s1+e);
*(s1+e)=t;
s++;
e--;
}
printf("ans is : %s\n",s1);
getch();
}
/* OUTPUT */
============================
enter your string : DNP DEVELOPER
ans is : REPOLEVER PND
* * * * * * * * * * * * * *
>> IF YOU LIKE THIS BLOG, PLEASE SHARE AND SUBSCRIBE. ALSO COMMENT FOR THIS BLOG.>> IF YOU HAVE ANY QUESTIONS PLEASE ASK IN COMMENT.>> IF YOU WANT TO LEARN HTML WITH OUTPUT, SO VISIT THIS BLOG>> MY INSTAGRAM ID : dnp176
👍👍👍👍
ReplyDeletemast 6...just output ma "DEVELOPER" NA BADLE "REVELOPER" thai gyu 6...
ReplyDeletethat is not mistake, but it is output of that program.
Delete