how to reverse string "Hello World" by using pointers only.
Without any temp var
Answer / aravind
#include<stdio.h>
char reverse(char *, char *);
int main()
{
char a[]="hello"
char b[]="world";
gets(a,b);
puts(a); /*displays Hello world*/
reverse(a,b);
char reverse(char *ptr, char *ptr1)
{
int i,j;
for(i=0;i!='\0';i++)
{
printf("%s",*ptr);
ptr++;
}
for(j=0;j!='\0';j++)
{
printf("%s",*ptr1);
ptr1++;
}
gets(*ptr1,*ptr);
puts(*ptr1); /*displays world hello*/
}
| Is This Answer Correct ? | 0 Yes | 10 No |
Is fortran faster than c?
main() { enum{red,green,blue=6,white}; pf("%d%d%d%d", red,green,blue,white); return 0; } a)0 1 6 2 b)0 1 6 7 c)Compilation error d)None of the above
wat is the difference between a definition and declaration? float y;---it looks like a declaration..but it s a definition.how?someone explain
I was asked to write a program in c which when executed displays how many no.of clients are connected to the server.
why we wont use '&' sing in aceesing the string using scanf
what is the difference between char * const and const char *?
What are the difference between a free-standing and a hosted environment?
Why cd or dvd are round why not square.
An application package has been provided to you without any documents for the following application. The application needs to be tested. How will you proceed?
how to find the binary of a number?
Explain how can you be sure that a program follows the ansi c standard?
I came across some code that puts a (void) cast before each call to printf. Why?