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 |
Write a program to print factorial of given number using recursion?
What is #line used for?
What is the use of a static variable in c?
Place the #include statement must be written in the program?
Write a C program to perform some of the operation which can be performed using Single linked list
Difference between macros and inline functions? Can a function be forced as inline?
0 Answers HAL, Honeywell, Zomato,
Explain the differences between public, protected, private and internal.
Badboy is defined who has ALL the following properties: Does not have a girlfriend and is not married. He is not more than 23 years old. The middle name should be "Singh" The last name should have more than 4 characters. The character 'a' should appear in the last name at least two times. The name of one of his brothers should be "Ram" Write a method: boolean isBadBoy(boolean hasGirlFriend , boolean isMarried, int age , String middleName , String lastName , String[] brotherName); isHaveGirlFriend is true if the person has a girlfriend isMarried is true if the person is married age is the age of the person middleName is the middle name of the person lastName is the last name of the person brotherName is the array of the names of his brothers
Given an array of characters, how would you reverse it? How would you reverse it without using indexing in the array?
When should a type cast not be used?
hi any body pls give me company name interview conduct "c" language only
What are the 5 organizational structures?