How to reverse a String without using C functions ?

Answers were Sorted based on User's Feedback



How to reverse a String without using C functions ?..

Answer / snjui

#include<stdio.h>
#include<conio.h>
void main()
{
getch()
}

Is This Answer Correct ?    2 Yes 14 No

How to reverse a String without using C functions ?..

Answer / saurabh

int i=0,j=0;
while(str[i++))
{j++;}
i=0;
j--;
while(i<j)
{ char tmp;
tmp = str[i];
str[i]=str[j];
str[j]=tmp;
}

Is This Answer Correct ?    20 Yes 40 No

How to reverse a String without using C functions ?..

Answer / prof.muthu

#include<muthu.h>
main()
{
printf("\nthe reverse string is:",reversemuthu(s1);
}

output:
original string is: muthu
the reverse string is: uthum

Thanks and recgards:
prof.muthu ph:9962940220
you can call me any time any where...!

Is This Answer Correct ?    20 Yes 138 No

Post New Answer

More C Code Interview Questions

main() { show(); } void show() { printf("I'm the greatest"); }

2 Answers  


What is the output of the program given below main() { signed char i=0; for(;i>=0;i++) ; printf("%d\n",i); }

1 Answers  


#define square(x) x*x main() { int i; i = 64/square(4); printf("%d",i); }

4 Answers   Google, HCL, Quick Heal, WTF,


main() { unsigned int i=10; while(i-->=0) printf("%u ",i); }

2 Answers   HP,


main() { int x=5; clrscr(); for(;x<= 0;x--) { printf("x=%d ", x--); } } a. 5, 3, 1 b. 5, 2, 1, c. 5, 3, 1, -1, 3 d. ā€“3, -1, 1, 3, 5

2 Answers   HCL,


how can i cast a char type array to an int type array

2 Answers  


write a c-program to display the time using FOR loop

3 Answers   HCL,


main() { int c[ ]={2.8,3.4,4,6.7,5}; int j,*p=c,*q=c; for(j=0;j<5;j++) { printf(" %d ",*c); ++q; } for(j=0;j<5;j++){ printf(" %d ",*p); ++p; } }

1 Answers  


void main() { int i; char a[]="\0"; if(printf("%s\n",a)) printf("Ok here \n"); else printf("Forget it\n"); }

3 Answers   Accenture,


program to find the roots of a quadratic equation

14 Answers   College School Exams Tests, Engineering, HP, IIIT, Infosys, Rajiv Gandhi University of Knowledge Technologies RGUKT, SSC,


main() { int i=5; printf(ā€œ%dā€,i=++i ==6); }

1 Answers  


Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it.

9 Answers   Microsoft,


Categories