How to reverse a String without using C functions ?

Answer Posted / vivekanandan

#include<stdio.h>
#include<string.h>
#include<conio.h>
void main()
{
int len=0;
char str[100];
clrscr();
printf("\nEnter the string");
gets(str);
while(str[len]!='\0')
{
len++;
}
printf("\nThe Reverse of the string is");
for(int i=0;i<=len;i++)
{
printf("%c",str[len-i]);
}
getch();
}

Is This Answer Correct ?    5 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between proc means and proc tabulate ? explain with a simple example when you have to use means or tabulate?

3700


write a simple calculator c program to perform addition, subtraction, mul and div.

3134


How can you relate the function with the structure? Explain with an appropriate example.

2911


Write a Program in 'C' To Insert a Unique Number Only. (Hint: Just Like a Primary Key Numbers In Database.) Please Some One Suggest Me a Better Solution for This question ??

1766


can you use proc sql to manpulate a data set or would u prefer to use proc report ? if so why ? make up an example and explain in detail

2317






could you please send the program code for multiplying sparse matrix in c????

3063


how to test pierrot divisor

2247


how to create a 3x3 two dimensional array that will give you the sums on the left and bottom columns

3117


write a program for area of circumference of shapes

2026


Given a spherical surface, write bump-mapping procedure to generate the bumpy surface of an orange

2854


Write a routine to implement the polymarker function

4372


What is data _null_? ,Explain with code when u need to use it in data step programming ?

2813


How can I Create a C program in splitting set of characters to specific subsets. Example: INPUT SET OF CHARACTERS: Therefore, my dear brothers and sisters, stand firm. Let nothing move you. Always give yourselves fully to the work of the Lord, because you know that your labor in the Lord is not in vain. SPLIT INTO HOW MANY CHARACTERS PER SUBSETS: 10 OUTPUT: Therefore, my dear b rothers an d sisters, stand fir m. Let not hing move you. Alway s give you rselves fu lly to the work of t he Lord, b ecause you know that your labo r in the L ord is not in vain.

1922


Write a program to model an exploding firecracker in the xy plane using a particle system

3680


To Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates. String contains only lowercase characters ['a'-'z']

488