Home Tutorialhelp Comment there is a problem in the code reverse string

 
 

Comment

Arun
there is a problem in the code reverse string,
May 9, 2010 at 4:18 PM

the function reverse() shall be defined as below:

int reverse(int i)
{
if (i<(strlen(st)/2))
{
char c;
for(i = 0;i<(strlen(st)/2);i++)
{
c= st[i];
st[i]=st[strlen(st)-i-1];
st[strlen(st)-i-1]=c;
}
}
return 0;
}

The function written in the website is not given correct output, however it is a good start.
View All Comments | View Tutorial
Advertisement
Related Tutorial and Articles
C Tutorials

C String Reverse
C String Reverse       In this section, you will study how to reverse a string. You can see... shown above will reverse the string. Here is the code:   

Java Beginners

reverse
reverse  program to read a string and print the reverse string   Hi Friend, Try the following code: import java.util.*; public class ReverseString{ public static void main(String[]args){ Scanner input=new 

Java Tips and Examples

String Reverse in Java
String Reverse in Java       In this example we are going to reverse a given string... the input string by using the StringBuffer(String string) method, reverse 

Development process Questions

reverse albhabet
reverse albhabet   e d c b a d c b a c b a code for this pattern   Here is a code that displays the following pattern: e d c b a d c b a c b a b a a public 

Java Tips and Examples

String Reverse Using StringUtils
String Reverse Using StringUtils       In this example we are going to reverse a given string using... and String.trim() for trim. The methods used: reverse(String str 

Java Interview Questions

reverse string
reverse string  how to reverse a string without changing its place...=input.nextLine(); String reverse = new StringBuffer(str).reverse().toString...{ public static void main(String[]args){ Scanner input=new Scanner 

Java Beginners

Out of bounce exception in the string reverse program - Java Beginners
Out of bounce exception in the string reverse program  In the given... void main(String[] args) { String string=args[0]; String reverse = new StringBuffer(string). reverse().toString(); System.out.println 

Core Java

Reverse String Program in Java
source code More tutorials on String handling in Java: Java...Reverse String Program in Java We are going to describe about reverse...[]) { String string, reverse = ""; Scanner in = new Scanner 

C++

C Tutorials
() is created.   C String Reverse... C Tutorials       In this section we have given large number of tutorials on C 

Blog

Site map - C Tutorials
; | XPath Tutorials | HTML Tutorials C Tutorial Section C String Reverse | C String Substring | C String Tokenizer | C String uppercase | C...; C Tutorials  | Java Tutorials | PHP Tutorials  | Linux 

Java Interview Questions

Getting the string in reverse
Getting the string in reverse  i am giving the string=" i am sachin".for this output is "sachin am i".please give me the code?   Hi Friend, Visit Here Thanks 

Java Interview Questions

Getting the string in reverse
Getting the string in reverse  i am giving the string=" i am sachin".for this output is "sachin am i".please give me the code?   Hi Friend, Try the following code: import java.util.*; class ReverseWords{ public 

Development process Questions

reverse alphabet
reverse alphabet  e d c b a d c b a c b a b a a code for this pattern in c language 

Java Beginners

string
string  program for String reverse and replace in c,c++,java... code: import java.util.*; class ArrayReverse { public static void main(String[] args) { String array[]=new String[5]; Scanner input 

Programming Tutorials

JavaScript reverse text string
, you will get the reverse string in the same text box. Here is the code... JavaScript reverse text string...; In this section, we are going to reverse the text string using JavaScript 

Java Code Examples

Java reverse words in a string using only loops
Java reverse words in a string using only loops In this tutorial, you will learn how to reverse words in a string without using any inbuilt methods like...;=c.length;i++) { if(i==c.length) { reverse(c,word_start_index,i-1); } else 

Java-Tutorials

String Reverse In Java Example
String Reverse In Java Example In this tutorial we will read about reversing... reverse value. Reversing a String is an operation to represent an original String... to display the String in reverse order. Syntax of StringBuilder reverse() method 

Programming Tutorials

Reverse String using Stack
Reverse String using Stack You all are aware of Stack, a data structure... the string using these operations. Here is the code: import java.util.... in the reverse order from that in which they are added. The push operation 

General

Java Reverse String Pattern
array and prnt it also. Here is the code Java Reverse String: ...Java Reverse String Pattern In this section, we have displayed a string in reverse pattern. For this,we have specified a string which is first converted 

Java Beginners

Reverse string in BlueJ
Reverse string in BlueJ  wap that user enter a string and one word. so i want that program search word in string entered by user if word exist in string than reverse only that word and give output. e.g This is a flower (string 

Java Interview Questions

String reverse program
String reverse program  write a java program for reverse string? if the string is "Hi welcome to hyderabad" the reverse string is "hyderabad... for help. You can split the String into String array using split method of String 

Java Beginners

string reverse order
string reverse order  Hi I have string s= " kalins naik" then how can i print string s=" naik kalins" Thanks kalins naik   import java.util.*; public class ReverseWords{ public static void main(String[] args 

Java Beginners

reverse the charstring
reverse the charstring  how to reverse any character of the string 

General

Reverse String
Reverse String      ... is the output: C:\Examples>java Reverse roseindia  aidniesor...: In the example given below, we are taking a command line argument and storing it in a string 

Java Beginners

print reverse string without api
print reverse string without api  accept a string and print reverse without using api 

General

Java Reverse words of the String
Reverse words of the String Java Programming In this section, we are going to reverse the words of the string. For this, we have allowed the user to enter... which return the reverse order of the tokens. Here is the code 

Java Beginners

Write a java program that prints the decimal representation in reverse. (For example n=173,the program should print 371.)c
Write a java program that prints the decimal representation in reverse... static void main(String args[]) { System.out.println("Enter the number"+n...("code sample");   import java.util.*; public class ReverseNumber 

Java Beginners

A Program To Reverse Words In String in Java .
A Program To Reverse Words In String in Java .  A Program To Reverse Words In String in Java :- For Example :- Input:- Computer Software Output :- Software Computer 

Java Beginners

A Program To Reverse Words In String in Java .
A Program To Reverse Words In String in Java .  A Program To Reverse Words In String in Java :- For Example :- Input:- Computer Software Output :- Software Computer 

Java Beginners

A Program To Reverse Words In String in Java .
A Program To Reverse Words In String in Java .  A Program To Reverse Words In String in Java :- For Example :- Input:- Computer Software Output :- Software Computer 

Java Beginners

A Program To Reverse Words In String in Java .
A Program To Reverse Words In String in Java .  A Program To Reverse Words In String in Java :- For Example :- Input:- Computer Software Output :- Software Computer 

Java Beginners

A Program To Reverse Words In String in Java .
A Program To Reverse Words In String in Java .  A Program To Reverse Words In String in Java :- For Example :- Input:- Computer Software Output :- Software Computer 

Programming Tutorials

C++Tutorials
other tutorials, such as C++: Annotations by Frank Brokken and Karel Kubat...; The CPlusPlus Language Tutorial These tutorials explain the C++ language... Borland C++ 5.0 as I am then you will have no problem with the project here 

Java Beginners

Reverse word of string in alphabetical order
Reverse word of string in alphabetical order  wap a program that reverse word of string in alphabetical order. e.g. input by user The purpose of education is to replace an empty mind with an open one output 

Core Java

String reverse in java
String reverse in java In this section we are going to discuss about how to reverse a sting in java. There are many ways to reverse a string in java ... can easily reverse a string, this is the most easy way to reverse a string 

Java Beginners

A Program To Reverse Words In String in Java
A Program To Reverse Words In String in Java  A Program To Reverse Words In String in Java for example: Input:- Computer Software Output... Tell Me This Program.  Here is an example that reverse the words 

Java Beginners

Reverse - Java Beginners
Reverse   How to sort an array of strings(in reverse alphabetical... the following code: import java.util.*; import java.io.*; public class City{ public static void main(String[]args)throws IOException 

Java Interview Questions

how to reverse a string without changing its place
how to reverse a string without changing its place  how to reverse a string without changing its place   Hi Friend, Another way of reversing string: import java.util.*; public class ReverseString{ public static 

Java Code Examples

Java reverse number
Java reverse number In this tutorial, you will learn how to reverse a number...(/) and remainder operator(%) to reverse the number. The division operator returns... ReverseNumber{ public static void main(String [] args){ Scanner input=new Scanner 

Java Interview Questions

ARRAY REVERSE - Java Interview Questions
} I Want Print Reverse Order Like This 4,6,9,7,6,4,3,1 Using loops I Want Source Code Plz Help me?  Hi Friend, Try the following code: class ArrayReverse{ public static void main(String[]args){ int arr[]={1,3,4,6,7,9,6,4 

General

Read a string and reverse it and then print in alphabetical order.
Read a string and reverse it and then print in alphabetical order... given below takes string value from user and reverse that string by using String reverse(String str) method and set in alphabetical order by String 

CVS Questions

c++
c++  Write a console based C++ program that reads student information... name with the minimum GPA 7) Display Student GPAs as Letter Grades (A, B, C, D...: ID: int FirstName: string SecondName: string FirstExam: int SecondExam 

Java Beginners

reverse words in a string(words seperated byone or more spaces)
reverse words in a string(words seperated byone or more spaces)  reverse words in a string(words separated by one or more spaces 

Mobile Applications Questions

copy string to string objective c
copy string to string objective c  How to copy a value of NSString to another string in Objective C? I have to different views and i am will to show the NSString value in both of them. Thanks 

Java Beginners

Reverse integer array program
Reverse integer array program  Been tasked with the following... with all the elements in reverse order. For example, if the input array is [2, 4, 6, 8.... I have this so far: public static int [] reverse (int a[]){ for ( int 

Design concepts & design patterns Questions

string
string  write a program to accept the string and store the reverse stream into another array and print 

Java Beginners

Array /string based problem....
Array /string based problem....  thanx to help me.but again a problem is here that it sorts single char as (a,b,c,n,m)but not the string .and also... solve this problem also as soon as possible..... import java.util.*; public class 

Java Beginners

Reverse
Reverse  How to reverse two digits in javaprogramming 

Java Beginners

Reverse
Reverse  How to reverse two digits in javaprogramming 

Java Beginners

quiz asked by my lecturer for array reverse....
quiz asked by my lecturer for array reverse....  consider a 2 dimensional array size m by n.Derive a function that can be used to reverse...; Hello Friend, Try the following code: import java.util.*; public class 

Mobile Applications Questions

objective c if string equals
objective c if string equals   Checking if a string is equal to ' " '   In objective c, isEqualToString is a keyword that allows you to check if the string is equal to or not. if ([text isEqualToString 

Mobile Applications Questions

Parsing string in objective c
Parsing string in objective c  Hi, How can i parse a string in Objective c?? Thanks.   Parsing string in objective c This example will also help you to separate the strings separated by one component 

JavaScript Questions

Reverse Order Java
Reverse Order Java   I am trying to get this into reverse order. Does... void main(String[] args) { Scanner kybd = new Scanner(System.in... static void main(String[] args) { Scanner kybd = new Scanner(System.in 

Java Code Examples

Java reverse string without using inbuilt functions
Java reverse string without using inbuilt functions In this tutorial, you will learn how to reverse string without using any inbuilt functions. Here, we have created a method to reverse the string and returns a new string with reverse 

Java Tips and Examples

Programming - reverse() method
Java: Programming - reverse() method Problem Write a method which has one parameter, a string, which returns a string which is the parameter will all... be defined using this header. public static String reverse(String text 

C Tutorials

C String Substring
C String Substring      ... in C. You can see in the given example, a string and a method substring... are the starting and ending index values of the string.  Here is the code 

C Tutorials

C String Copy
C String Copy       In this section, you will learn how to copy the string in C. You can see...; } Output will be displayed as: STRING~1.EXE Download Source Code 

Java Code Examples

Java Reverse integer array
Java Reverse integer array In this tutorial, you will learn how to reverse integer array. Here, we have created a method to reverse an array which has been passed as a parameter and returns a new array with all the elements in reverse 

Java Beginners

c c++ - Java Beginners
]; String name = f[1]; String c = f[2]; String note = f[3...]; String name = st[1]; String c = st[2]; String note = st[3]; if (id.equals... = f[1]; String c = f[2]; String note = f[3]; if (!id.equals(t1 

C Tutorials

C String to Int
C String to Int       In this section, you will learn how to convert a string represented value...; } Output will be displayed as: STRING~1.EXE Download Source Code:   

Programming Tutorials

Overview of Networking through JAVA,Find the Host name in reverse of given IP address
Find the Host name in reverse of given IP address...() method using the getHostName() method. Here is the Code of the Example...;(String[] args) {   try {   InetAddress  

Swing AWT

c c++ - Swing AWT
c c++  Write Snake Game using Swings  Hi Friend, Try the following code: 1)SnakeGame.java: import javax.swing.JFrame; public...); } public static void main(String[] args) { new SnakeGame(); } } 2 

C Tutorials

C String length
C String length       In this section, you will learn how to determine the length of a String in C. You can see in the given example, we have declared a string and initialize 

Java Tips and Examples

Example: String reverse
Example: String reverse The following program reverses a string in a very... 31 // File : loops/reverse/Reverse.java // Purpose: Reverse a string using... javax.swing.*; public class Reverse { public static void main(String 

Java Beginners

string
string   just i want to a program in a short form to the given string in buffered reader for example input string: Suresh Chandra Gupta output: S. C...; public class StringTest { public static void main(String [] args 

Mobile Applications Questions

convert char to string objective c
convert char to string objective c  Converting char to string in objective c   NSString *s = [[NSString alloc] initWithBytes:arr + 2 length:3 encoding:NSUTF8StringEncoding 

Ajax Questions

c++ new, delete, string class
c++ new, delete, string class  Write one program containing all these string exercises. Read a string from the user into a string named string1... contained in string1: Exercise 1 Good morning Create a new string named string2 

Java Beginners

programming c#
programming c#   create and make use of at least one class with appropriate instance methods to solve the programming problem. use console-based... on the console window. predefine methods of the "string" and "math" class should be used 

C Tutorials

C Array of String
C Array of String       In this section you will learn how to create an array of string in C..., a format specifier %s is used with the printf to print the string. Here is the code 

C Tutorials

C String uppercase
C String uppercase       In this section, you will learn how to convert a string value in to uppercase. In the given example, we have define a string in lowercase characters 

Design concepts & design patterns Questions

classes in c++
classes in c++  1- design and implement a class datatype... on this class.   Here is the Java code: public class DayType{ final...) { return (day + days) % 7; } public String toString 

PHP Tutorial

PHP Array Reverse Sorting
PHP Array Sort in Reverse Order In PHP there are three functions are available which are used to sort the values, keys in reverse order. The functions... in reverse order, rsort() is just opposite sort() function: General 

Java Beginners

reverse arrays in java
reverse arrays in java  how do i make a code that can be used to reverse the elements of an array in two dimension such that the last element of an array becomes the first element of the array and the first element of an array 

Development process Questions

c++
c++  differenciate btw.-a)local & public variables b)pre-defined & user defined functions c)fnctn prototype,defination & fnctn code.use code examples 

Development process Questions

C++
C++  differenciate btw.-a)local & public variables b)pre-defined & user defined functions c)fnctn prototype,defination & fnctn code.use code examples 

Development process Questions

c++
c++  differenciate btw.-a)local & public variables b)pre-defined & user defined functions c)fnctn prototype,defination & fnctn code.use code examples 

C Tutorials

C String lowercase
C String lowercase       In this section, you will study how to convert the string to lowercase. You can see in the given example, we have define a string in uppercase 

Java Beginners

C#
C#  i need a code that will make program perform the basic operations upon the data Listview save, update and cancel 

Spring Framework Questions

c++
c++  write a program that gets a key or character from the keyboard and displays it ASII code in decimal, hexadecimal and binary form.It must also give a description of the key pressed 

C Tutorials

C String Remove Spaces
C String Remove Spaces       In this section, you will study how to remove spaces from the string. You can see in the given example, we have define the string and passed 

JSP Tutorials

Comparing Two String with <c:if>
Comparing Two String with <c:if>   ... string is equal to the another string or not. The test attribute of the <c... or not, then in these condition the <c:if> tag is used. This tag will not work if the value 

C Tutorials

C String Tokenizer
C String Tokenizer      ... the string into a series of tokens. You can see in the given example, we have define a string and a pointer. The expression ch = strtok (st," " 

C Tutorials

C String Concatenation
C String Concatenation     ... and returns the concatenated string as a char.   Here is the code... in C. You can see in the given example, we have declared two strings in order 

Free C# books

C and C++ books
-fashioned C string) and in the second case a zero-terminated array of XMLCh's... In this section for example-based C tutorials that introduce you to ODBC API programming in C. Each tutorial contains C ODBC code samples that illustrate 

Mobile Applications Questions

Select string from array in objective c
Select string from array in objective c  Hi, I wanted to select a string from the database table in objective c. But somehow it is not working..can-you suggest anything regarding the fetch query in objective c? Thanks.   

HTML Questions

problem 2= C#
C# registration form If user fails to enter for example User Name then the Message box should pop up with "Please Enter your User Name!!"  Write the code for the following form based on the criteria given below: User 

Mobile Applications Questions

match string to regular expression - Objective C
match string to regular expression - Objective C  How to match string value to regular expression in objective c?   Use NSPredicate. See the example given below... NSString *searchString = @"loginStatus"; NSString 

Development process Questions

java code for conversion of arraylist to string - Development process
by "value" as a delimiter  Hi friend, Code to solve the problem...java code for conversion of arraylist to string  Hi, i have an arraylist contains [a,b,value,c,d,value]when ever value comes it will split 

Java Beginners

C# question
C# question  In C#, string is a class or primitive type. Explain 

General

Find the Host name in reverse of given IP address
Find the Host name in reverse of given IP address...() method using the getHostName() method. Here is the Code of the Example...;(String[] args) {   try {   InetAddress  

MySQL

MySQL String Function
returns the ASCII code value of the leftmost character of the String str. Returns... to return the reverse of String str. Example:  ... MySQL String Function       

Development process Questions

C,C++
C,C++  int i=100,j=20; int c=i&j; int r=i|j; printf("%d",c); printf...(){ int i=100,j=20; int c=i&j; int r=i|j; printf("%d",c); printf("%d",r); getch(); } The above code displays the output: 4116   Sir how i& 

Java Beginners

problem
(String args[])throws IOException { BufferedReader in =new BufferedReader(new... c[]=new int [m+n]; for (int i=0;i<m;i++) { a[i]=Integer.parseInt...()); } for( ;i<m && j<n; ) { if (a[i]< b[j]) { c[k]=a[j]; j 

Mobile Applications Questions

Why NSString Objective C
C and how to define and initialize the NSString Class?   Why NSString Objective C NSStrings is a class that deals with strings in objective c... = @"hello world"; You can also compare a string using the "isEqualToString 

Development process Questions

c programing
c programing  Write 2 implementations of C's string copy routine, one with a loop and the other using recursion. What is the security risk with this routine? The function should have the signature: char* strcpy(char* destination 

Development process Questions

c programing
c programing  Write 2 implementations of C's string copy routine, one with a loop and the other using recursion. What is the security risk with this routine? The function should have the signature: char* strcpy(char* destination 

General

JavaScript array reverse example
by using the method reverse(). Here is the full example code of JavaScript array... JavaScript array reverse example       JavaScript Array class have one method reverse() which 

Java Magazine Questions

STRING.....
STRING.....  plzz sent me d code for counting vowels in a string... gui programme 

Java Beginners

String
String  can u resolve anybody my problem is how to remove duplicate characters in string?   import java.util.*; class RemoveDuplicateCharatcersFromString { public static String removeDuplicates(String

Java Tips and Examples

Java String Occurrence in a String
of a String in another String. Here we have already taken a String. Description of the code: In the program code given below, we will find another String... Java String Occurrence in a String    

Advertisements Advertisements
 

 

 

DMCA.com