How to reverse a String without using C functions ?

Answer Posted / dhiru

#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()

{
clrscr();
char a[30],ch[30];
int i,j,count=0,k=0;
printf("enter string in array\n");
gets(a);

//j=strlen(a);
for(i=0;a[i]!='\0';i++)
{
count++;
}
printf("length=%d\n",count);
printf("Reverse string===");
for(i=count;i>=0;i--)
{
putchar(a[i]);
}

getch();
}

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is full form of PEPSI

2126


#include int main(void) { int a=4, b=2; a=b<>2 ; printf("%d",a); return 0; }

1299


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

735


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

4059


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


Write a routine to implement the polymarker function

4590


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


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

2259


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

3391


Design an implement of the inputs functions for event mode

3177


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


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

3131


Can you send Code for Run Length Encoding Of BMP Image in C Language in linux(i.e Compression and Decompression) ?

4080


Set up procedure for generating a wire frame display of a polyhedron with the hidden edges of the object drawn with dashed lines

3253


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

3351