answersLogoWhite

0


Best Answer

//code for reverse string

class ReverseString

{

public static void main(String arg[])

{

StringBuffer s=new StringBuffer("abcdef");

System.out.println("Before reversing :"+s);

s.reverse();

System.out.println("after reversing.."+s);

}

}

User Avatar

Wiki User

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

Wiki User

14y ago

#include
#include
typedef struct stack
{
char b[100];
int top;
}stack;
void push(stack *s,char k)
{
if(s->top==99)
printf("\n Stack is full ");
else
s->b[++s->top]=k;
}
char pop(stack *s)
{
char c;
if(s->top==(-1))
printf("\n Stack is empty");
else
else
c=s->b[s->top--];
return c;
}
void main()
{
char name[100];
stack s;
clrscr();
s.top=-1;
printf("\nEnter name :");
gets(name);
int i=0;
while(name[i]!='\0')
{
push(&s,name[i]);
i++;
}
printf("\n Reverse string is :");
while(s.top!=-1)
{
printf("%c",pop(&s));
}
getch();
}



google_protectAndRun("ads_core.google_render_ad", google_handleError, google_render_ad);
Responses
No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks Popular Tags What are tags ? Search Tags Sign In to add tags. (No tags found.)

Post Feedback
var tf_city = escape("Mumbai"); var tf_clickURL = 'http://a.tribalfusion.com/h.click/aXmP0p5taN56JZcmrQZdXcfSYVY01GZbOpTJS5F3WTFfGVmY3PTb5QVnrPdUyYHZbmTmrp2V3YYbYBT6ar2PY8QPMF4WntXWYAntan4mBQ5VMaUVJcUcJgP6MMWWFVWrZb02FAnWa7pVaU9SPThopeLmmARsVyas8mMv6PPQpb3OQXXy9XbrDqE2pUyJoCTXJ/http://www.naukri.com/tieups/tieups.php?othersrcp=8402'; var tf_flashfile = 'http://cdn5.tribalfusion.com/media/1697946/naukri-336x280.swf?tf_city='+tf_city; var tf_imagefile = 'http://cdn5.tribalfusion.com/media/1697946/naukri_336x280.gif'; var tf_width = 336; var tf_height = 280; var tf_background= '#ffffff'; var tf_click_command = 'CLICK'; var tf_ignore_fscommand_args = 0; var tf_use_embedded_flash_url = 0; var tf_append_fscmd_args_to_click = 0; var tf_use_flash_wrapper = 0; var tf_id = '207429194'; var tf_click = 'http://a.tribalfusion.com/h.click/aXmP0p5taN56JZcmrQZdXcfSYVY01GZbOpTJS5F3WTFfGVmY3PTb5QVnrPdUyYHZbmTmrp2V3YYbYBT6ar2PY8QPMF4WntXWYAntan4mBQ5VMaUVJcUcJgP6MMWWFVWrZb02FAnWa7pVaU9SPThopeLmmARsVyas8mMv6PPQpb3OQXXy9XbrDqE2pUyJoCTXJ/'; var tf_frame = tf_flashfile; function TFclick207429194_DoFSCommand(command, args){ if (command 1) { window.open(tf_clickURL207429194,'_blank'); } } <A HREF="http://a.tribalfusion.com/h.click/aXmP0p5taN56JZcmrQZdXcfSYVY01GZbOpTJS5F3WTFfGVmY3PTb5QVnrPdUyYHZbmTmrp2V3YYbYBT6ar2PY8QPMF4WntXWYAntan4mBQ5VMaUVJcUcJgP6MMWWFVWrZb02FAnWa7pVaU9SPThopeLmmARsVyas8mMv6PPQpb3OQXXy9XbrDqE2pUyJoCTXJ/http://www.naukri.com/tieups/tieups.php?othersrcp=8402207429194" TARGET="_blank"><IMG SRC=http://cdn5.tribalfusion.com/media/1697946/naukri_336x280.gif WIDTH=336 HEIGHT=280 BORDER=0></A>
This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: C program of matrix addition,substraction,and multiplication
Previous Resource: C Program of stack demonstration
Return to Discussion Resource Index
Post New Resource
Category: Computer & Technology

Post resources and earn money!
Related Resources
  • C program to print all Prime number between a range

  • C program to calculate sum of element of a vector using function

  • C program the value of x^y using recursion

  • C program of finding factorial by using recursion

  • C program to read and print the element of matrix using pointer

  • C Program of file handling with output


google_protectAndRun("ads_core.google_render_ad", google_handleError, google_render_ad);
Advertise Here

Watch TV Channels

  • Watch Asianet online
  • Kairali TV in internet
  • Surya TV online
  • Amritha TV Channel

addthis_pub = 'indiastudychannel';

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

/* using ellipses (...) to indicate tabs for clarity */

reverse (char *str) { /* print a string backwards */

... char *revstr = str; /* set to beginning of string */

... while (*revstr++ != '\0'); /* find end of string */

... revstr--; /* back up to the null */

... while (str <= revstr) printf ("%c", *--revstr); /* print each character - note pre decrement */

... printf ("\n"); /* print new-line */

}

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

#include<stdio.h>

#include<conio.h>

#include<string.h>

int main(){

int i,j,k;

char str[20];

char temp[20];

printf("enter the string");

scanf("%d",&str);

char start=0;

for(i=0;i<strlen(str);i++)

{

if(str[i]==" " str[i]=='\0')

{

k=0;

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

{

temp[k]=str[i];

k++;

}

temp='\0';

strrev(temp);

printf("reverse the string %s",temp);

start=i+1;

}

}

return(0);

}

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

REM ***************************************

REM By Leo French

REM ***************************************

WORD$ = "Candy Apple Red"

L = LEN(WORD$): DIM N$(L)

FOR Y = 1 TO L: N$(Y) = MID$(WORD$, Y, 1): NEXT Y

TB = 50: PP = 0

CLS

FOR D = L TO 1 STEP -1

LOCATE 8, TB - PP: PRINT N$(D); : PP = PP + 1

SLEEP 1

NEXT D

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

Write your program and if you are having a problem post it here with a description of the problem you are having.

What you are asking is for someone to do your homework for you.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a program To print the reverse order of a string?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

How do you convert a number that consist of alphabet and number in reverse order?

To reverse a number, first convert the number to a string, then reverse the string. Given your number consists of alphanumeric characters, the number must already be a string so simply reverse the string: #include&lt;string&gt; using std::string; string reverse (const string&amp; s) { string str {}; for (auto c : s) str.insert (str.begin(), c); return str; } int main () { std::cout &lt;&lt; "Enter a number: "; string s {}; std::cin &gt;&gt; s; std::cout &lt;&lt; "The number in reverse is: " &lt;&lt; reverse (s); }


How do you get value of a string in reverse order in c?

Assume C#, not C: Traditional way: public string Reverse(string s) { if (string.IsNullOrEmpty(s)) return s; // "" or null char[] characters = s.ToCharArray(); Array.Reverse(characters); return new string(characters); } or as an extension method: public static string Reverse(this string s) { if (s == "") return ""; char[] characters = s.ToCharArray(); Array.Reverse(characters); return new string(characters); } The differences of the 2 methods above is on the caller (how to use Reverse()), and they may co-exist: For example: string test = "abc"; string result1 = Reverse(test); // traditional way string result2 = test.Reverse(); // call the extension


A program of c plus plus to accept the string and display the alternate characters in reverse order using pointer?

The following program prints every second character of the input in reverse order. #include&lt;iostream&gt; #include&lt;sstream&gt; int main() { std::cout &lt;&lt; "Input:\t"; std::string input = ""; std::getline (std::cin, input); if (input.size()) { std::cout &lt;&lt; "Output:\t"; unsigned index = input.size() / 2 * 2; do { index -= 2; std::cout &lt;&lt; input[index]; } while (index); std::cout &lt;&lt; std::endl; } }


How would you write a program that takes a string of characters and reverses them in the C programming language?

void main() {char a[30] = "India"; //Let the string be stored in a[30]; char b[30]; //declaring another string for(i=0;i&lt;strlen(a);i++) {b[strlen(a)-1 - i]=a[i];} //Now reverse string is stored in b; //to print it cout&lt;&lt;b; getch(); }


How do you program a reverse auto loan calculator in JAVA?

In order to program a reverse auto loan calculator in JAVA, you are going to need a lot of experience with JAVA. There are online tutorials that can help you set up with fundamentals of JAVA so that you will be able to create almost any basic program you want.

Related questions

How do you convert a number that consist of alphabet and number in reverse order?

To reverse a number, first convert the number to a string, then reverse the string. Given your number consists of alphanumeric characters, the number must already be a string so simply reverse the string: #include&lt;string&gt; using std::string; string reverse (const string&amp; s) { string str {}; for (auto c : s) str.insert (str.begin(), c); return str; } int main () { std::cout &lt;&lt; "Enter a number: "; string s {}; std::cin &gt;&gt; s; std::cout &lt;&lt; "The number in reverse is: " &lt;&lt; reverse (s); }


How do you get value of a string in reverse order in c?

Assume C#, not C: Traditional way: public string Reverse(string s) { if (string.IsNullOrEmpty(s)) return s; // "" or null char[] characters = s.ToCharArray(); Array.Reverse(characters); return new string(characters); } or as an extension method: public static string Reverse(this string s) { if (s == "") return ""; char[] characters = s.ToCharArray(); Array.Reverse(characters); return new string(characters); } The differences of the 2 methods above is on the caller (how to use Reverse()), and they may co-exist: For example: string test = "abc"; string result1 = Reverse(test); // traditional way string result2 = test.Reverse(); // call the extension


A program of c plus plus to accept the string and display the alternate characters in reverse order using pointer?

The following program prints every second character of the input in reverse order. #include&lt;iostream&gt; #include&lt;sstream&gt; int main() { std::cout &lt;&lt; "Input:\t"; std::string input = ""; std::getline (std::cin, input); if (input.size()) { std::cout &lt;&lt; "Output:\t"; unsigned index = input.size() / 2 * 2; do { index -= 2; std::cout &lt;&lt; input[index]; } while (index); std::cout &lt;&lt; std::endl; } }


How can you generate a palindrome from a given number?

You write the number and then follow it with the digits in reverse order.


How would you write a program that takes a string of characters and reverses them in the C programming language?

void main() {char a[30] = "India"; //Let the string be stored in a[30]; char b[30]; //declaring another string for(i=0;i&lt;strlen(a);i++) {b[strlen(a)-1 - i]=a[i];} //Now reverse string is stored in b; //to print it cout&lt;&lt;b; getch(); }


How do you write a sentence using taut?

" A guitar string needs to be quite taut in order for it to produce an even tone."


How do you program a reverse auto loan calculator in JAVA?

In order to program a reverse auto loan calculator in JAVA, you are going to need a lot of experience with JAVA. There are online tutorials that can help you set up with fundamentals of JAVA so that you will be able to create almost any basic program you want.


When a middle school student is able to demonstrate the he or she is able to hear a string of digits 1 2 3 4 etc and then repeat the string in reverse order the child is indicating that he or she is?

I have no clue what you're asking, could you dumb it down for me.


Write a program to sort elements of an array in ascending order?

import java.util.Arrays; public class arraysort { public static void main(String[] a) { int array[] = { 2, 5, -2, 6, -3 }; Arrays.sort(array); for (int i : array) { System.out.println(i); } } }


Write a program WAP to print a given integer in the reverse order?

int n; // the number you want to reverse int rev_n = 0; while (n &gt; 0) { // shift rev_n digits left rev_n *= 10; // put rightmost digit of n onto right of rev_n rev_n += n % 10; // remove rightmost digit of n n /= 10; }


What is a silly way to remember the planets backwards?

Write the names in order on a piece of paper, then turn it upside down and you can read the names in reverse order.


How can a stack determine if a string is a palindrome?

foreach char in string push on to stack create new string foreach char in string pop off and add to end of new string if new string equals old string palindrome else not palindrome //when you pop off the stack, the characters come off in reverse order, thus you have reversed the original string