How to reverse a String without using C functions ?
Answers were Sorted based on User's Feedback
Answer / snjui
#include<stdio.h>
#include<conio.h>
void main()
{
getch()
}
| Is This Answer Correct ? | 2 Yes | 14 No |
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 |
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 |
void main() { void *v; int integer=2; int *i=&integer; v=i; printf("%d",(int*)*v); }
main() { if (!(1&&0)) { printf("OK I am done."); } else { printf("OK I am gone."); } } a. OK I am done b. OK I am gone c. compile error d. none of the above
plz send me all data structure related programs
#if something == 0 int some=0; #endif main() { int thing = 0; printf("%d %d\n", some ,thing); }
posted by surbhi just now main() { float a = 5.375; char *p; int i; p=(char*)&a; for(i=0;i<=3;i++) printf("%02x",(unsigned char) p[i]); } how is the output of this program is :: 0000ac40 please let me know y this output has come
main() { printf("%d", out); } int out=100;
main() { int i, n; char *x = “girl”; n = strlen(x); *x = x[n]; for(i=0; i<n; ++i) { printf(“%s\n”,x); x++; } }
main() { char string[]="Hello World"; display(string); } void display(char *string) { printf("%s",string); }
main() { int i=5,j=10; i=i&=j&&10; printf("%d %d",i,j); }
Write a routine that prints out a 2-D array in spiral order
char *someFun1() { char temp[ ] = “string"; return temp; } char *someFun2() { char temp[ ] = {‘s’, ‘t’,’r’,’i’,’n’,’g’}; return temp; } int main() { puts(someFun1()); puts(someFun2()); }
main() { char *p = “ayqm”; printf(“%c”,++*(p++)); }
29 Answers IBM, TCS, UGC NET, Wipro,