How to reverse a String without using C functions ?

Answer Posted / savita chauhan

#include<stdio.h>
#include<conio.h>
int reverse(char *)
void main()
{
char a[];
int i,l;
clrscr();
printf("\n Enter the string");
gets(a);
l=reverse(a)-1;
printf("\n\n\n");
printf("\n Reverse is:");
while(l>=0)
{
printf("%c",a[l]);
l--;
}
getch();
}
int reverse(char *p);
{
int i=0;
while(*p!='\0')
{
i++;
p++;
}
return i;
}

Is This Answer Correct ?    10 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

write a function to give demostrate the functionality of 3d in 1d. function prototye: change(int value,int indexX,int indexY,int indexZ, int [] 1dArray); value=what is the date; indexX=x-asix indexY=y-axis indexZ=z-axis and 1dArray=in which and where the value is stored??

4398


write a program for area of circumference of shapes

2240


How do you verify if the two sentences/phrases input is an anagram using predefined functions in string.h and by using arrays?

2259


Cluster head selection in Wireless Sensor Network using C programming language.

3394


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

3291


why nlogn is the lower limit of any sort algorithm?

2554


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

2576


why do you use macros? Explain a situation where you had to incorporate macros in your proc report? use a simple instream data example with code ?

2513


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 ??

2141


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

3883


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']

739


Design an implement of the inputs functions for event mode

3179


What is the match merge ? compare data step match merge with proc sql merge - how many types are there ? data step vs proc sql

2639


Sir... please give some important coding questions asked by product companies..

2033


write a c program to input initial & final time in the format hh:mm and find the time intervel between them? Ex inputs are initial 06:30 final 00:05 and 23:22 final 22.30

2448