answersLogoWhite

0

#include <stdio.h>

#include <conio.h>

#include <string.h>

void main()

{

char str[10],temp;

int i,len;

printf("Enter String : ");

scanf("%s",str);

len=strlen(str)-1;

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

{

temp=str[i];

str[i]=str[len];

str[len--]=temp;

}

printf("%s",str);

getch();

}

Please do give your views on this.

With Regards,

Sumit Ranjan.

Analyst at RMSI Company.

User Avatar

Wiki User

15y ago

What else can I help you with?

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); }


Reverse of a string without using string handling function?

shashi


What is a Flow chart for finding factorial of a given number using recursion function?

no answer....pls post


How do you get odd ascii letters from a given string using string copy?

there is no such method using string copy


How do you reverse a string with out using strrev?

By writing user defined function.


String reverse program with single string and without using library functions in java?

You can create a separate string initially empty. Then using a loop, start at the end of the string and add it to the end of the other string. At the end of the loop, the other string would contain the reverse.


Is there a way to use regex to determine if a given string is a palindrome?

Yes, you can use regex to determine if a given string is a palindrome by reversing the string and then comparing it to the original string using regex.


Take input of string reverse the strring in python?

There are five common methods of string inversion in Python: using string slicing, using recursion, using the list reverse () method, using stack and using for loop. Use string slicing (most concise) s = &quot;hello&quot; reversed_ s = s[::-1] print(reversed_s) &gt;&gt;&gt; olleh Use recursive def reverse_ it(string): if len(string)==0: return string else: return reverse_ it(string[1:]) + string[0] print &quot;added &quot; + string[0] string1 = &quot;the crazy programmer&quot; string2 = reverse_ it(string1) print &quot;original = &quot; + string1 print &quot;reversed = &quot; + string2 Use the list reverse() method in [25]: l = ['a', 'B', 'C','d '] ...: l.reverse() ...: print (l) ['d', 'c', 'b', 'a'] Using stack def Rev_ string(a_string): L = list (a_string) # simulate all stacking new_ string = &quot;&quot; while len(l)&gt;0: new_ String + = l.pop() # simulate stack out return new_ string Use the for loop #for loop def func(s): r = &quot;&quot; max_ index = len(s) - 1 for index,value in enumerate(s): r += s[max_index-index] return r r = func(s) The above are the five common methods of string inversion in Python. I hope it can be helpful to your learning of Python strings


A program of reverse a number using recursion in C?

(in C#)string Reverse (string input) {There are two cases; the recursive case and the trivial case.The trivial case is when the string has zero or one character. In this case, the reversal of the string is the same.if (input.Length


Can you implement merge sort without using recursion?

Sure, recursion can always be substituted with using a stack.


How do you reverse the number using c sharp?

The following codes only applied to unsigned integers: public int Reverse(int inputNumber) { string inputString = inputNumber.ToString(); string reversed = StringUtil.Reverse(inputString); return int.Parse(reversed); } public class StringUtil { // returns a reversed string from the given one public static string Reserve(string originalString) { StringBuilder sb = new StringBuilder(); char[] charArray = originalString.ToCharArray(); for (int i = charArray.Length - 1; i &gt;= 0; i--) { sb.Append(charArray[i]); } return sb.ToString(); } }


Advantages and disadvantages of using recursion?

pata nhe