answersLogoWhite

0


Best Answer

#include<stdio.h>

#include<string.h>

void main()

{

char str[50],revstr[50];

int i=0,j=0;

clrscr();

printf("Enter the string to be reversed : ");

scanf("%s",str);

for(i=strlen(str)-1;i>=0;i--)

{

revstr[j]=str[i];

j++;

}

revstr[j]='\0';

printf("Input String : %s",str);

printf("\nOutput String : %s",revstr);

getch();

}

User Avatar

Wiki User

13y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

#include<stdio.h>

#include<conio.h>

void main()

{

int i=0;

char str[10];

clrscr();

printf("Enter the string:");

scanf("%c",str);

while(str[i]!='\0')

i++;

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

{

str1[j]=str[i];

j++;

}

str1[j]='\0';

printf("Reverse of a given string:",str1);

getch();

}

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

#include<stdio.h>

#include<conio.h>

#include<string.h>

void main()

{

char string1[20],string2[20];

int i,j,length;

printf("\nEnter the string : ");

gets(string1);

length=strlen(string1);

for(i=0;i<length;i++)

{

for(j=length;j<=0;j--)

string2[j]=string1[i];

}

printf("\nReversed string is : %s",string2);

getch();

}

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

char* strrev (char* string) {

char* temp = string;

char* last = string + strlen(string) - 1;

while (string < last) *(string++) = *(last--);

return temp;

}

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

#include<stdio.h>

int main (void)

{

int len, i, j;

char buff [512], tmp;

fgets (buff, sizeof (buff), stdio);

len= strlen (buff);

for (i=0, j=len-1; i<j; ++i, --j) {

tmp = buff[i];

buff[i] = buff[j];

buff[j] = tmp;

}

puts (buff);

return 0;

}

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

#include<stdio.h>

#include<conio.h>

#include<string.h>

void main()

{

char n[20];

int i,l=0;

clrscr();

printf("enter the string");

scanf("%s",&n);

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

{

l++;

}

for(i=l-1;i>=0;i--)

{

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

}

getch();

}

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

This is a homework question that has been asked several times before. Please check previous answers and also please check previous answers for any further questions that you may have. Others have done your current course and asked the questions before you.

You might consider paying attention in class and reading your text book, that strategy will give you the answers that you need.

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

using strrev() function in c directory using string.h header file

This answer is:
User Avatar

User Avatar

Wiki User

9y ago

C program to reverse a string

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a c program to reverse the string without using strrev?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering
Related questions

How do you write string in reverse through the HTML tags?

Not possible through html. Use php strrev function. For eg:


How do you reverse a string in PHP?

A predefined function can reverse a string as shown below:echo strrev('pizza'); // outputs: azzip


How do you reverse a string with out using strrev?

By writing user defined function.


Write c program to print palindrome using string without using strrev strlen strcam?

sdfdg


How do you reverse a string in PHP without using a function?

Without any function is impossible. So I'll assume you mean any coded function, in which case the predefined function below is your answer.$string = strrev($string);


How To find reverse of string without using strrev function with code?

with a loop. len= strlen (s); p= s; q= s+len-1; while (p&lt;q) { (swap) ++p; --q; }


Program for palindrome in php?

You could use a function like this:function isPalindrome($string) {$string = strtolower($string);return (strrev($string) == $string) ? true : false;}and then to check a palindrome call an if statement like so:if(isPalindrome($test)) {echo $test.' is a palindrome';}else {echo $test.' is not a palindrome';}


Write a PHP program to check whether the string is palindrome or not?

You can do this: &lt;?php if ( $word === strrev( $word ) ) { echo "The word is a palindrome"; } else { echo "The word is not a palindrome"; }


What is string library functions syntax?

String library function is one which is used to perform an operation in C-programming,without which library functions likestrlen(),strcp(),strcmp(),strdup(),strrev(),etc..,.can be performed


C program for checking a palidrome?

#include&lt;stdio.h&gt; main() { char a[20],b[20]; printf("enter a string"); scanf("%s",&amp;a); strcpy(b,a);//copies string a to b strrev(b);//reverses string b if(strcmp(a,b)==0)//compares if the original and reverse strings are same printf("\n%s is a palindrome",a); else printf("\n%s is not a palindrome",a); return 0; }


Wap in c plus plus to find out the string is palindrome or not in?

use the strrev() function on the given string and compare with original string.If both are equal they are palindromes else not.


Program to find palindrome using C programming?

#include&lt;stdio.h&gt; #include&lt;conio.h&gt; #include&lt;string.h&gt; void main() { char a[15],b[15]; printf("Enter the string\n"); scanf("%s",&amp;a); strcpy(b,a); strrev(a); if(strcmp(a,b)==0) printf("The String is a palindrome"); else printf("The String is not a palindrome"); }