answersLogoWhite

0

#include

#include

#include

int reverse(int i);

char st[]="ven123kat";

void main() {

printf("\nThe string is: %s", st);

reverse(0);

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

getch();

}

int reverse(int i) {

if (i<(strlen(st)/2)) {

char c;

c= st[i];

st[i]=st[strlen(st)-i-1];

st[strlen(st)-i-1]=c;

}

return 0;

}

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

What is the use of Reverse String in C program?

The use of the reverse string in C program is used to reverse the letters in the string. An example would be reverse me would be reversed to em esrever.


Why and operator can not be used in string of c program?

Any character can be used in string, except for \\0. char example [] = "A&amp;B|C";


C program plus copy of string to another?

strcpy


C plus plus program to perform string manipulation?

You do not need to program string manipulation as it is already part of the standard library. See std::string and std::wstring.


How do you write a c program to find a word in a string?

what is if(!(str[i]==32))


Write a c program using string concept enter a sting and replace the new string in to old string and find no of occurrence?

print c co com comp compu


How do you write a c program to find the smallest word in a string?

what is if(!(str[i]==32))


What is the program to create a string class which stores a string value in c plus plus?

C++ already provides a string class in the C++ standard template library. #include&lt;iostream&gt; #include&lt;string&gt; int main() { using namespace std; string s {"Hello world!"}; cout &lt;&lt; s &lt;&lt; endl; }


Do I need to write a program to find a substring in a given string in c plus plus?

No.


Can you use scanf to get a string to a c program?

Certainly. That's what sequence %s is good for.


C program to copy two strings in to a new string with out using stringcopy in borland c?

You can use so called concatenation of strings:{...string str1 = "something here";string str2 = " and something here";string newStr = str1 + str2;...}


Why does ISO C forbid converting a string constant to 'char' in C?

ISO C forbids converting a string constant to 'char' in C because string constants are read-only and attempting to modify them through a 'char' pointer can lead to undefined behavior and potential program crashes.