How to write a program for swapping two strings without
using 3rd variable and without using string functions.
Answer Posted / saptarshi
void main()
{
char *p="string1";
char *q="string2";
p^=q^=p^=q;
printf("%s,%s",p,q);
}
swapping the base pointers of the two strings may work...
if they are declared as character arrays, then it is not
possible as we cannot modify the value of array base
pointers...
| Is This Answer Correct ? | 10 Yes | 26 No |
Post New Answer View All Answers
What is the difference between fread and fwrite function?
What are linker error?
What is array in C
Hai what is the different types of versions and their differences
What are terms in math?
How do shell structures work?
the factorial of non-negative integer n is written n! and is defined as follows: n!=n*(n-1)*(n-2)........1(for values of n greater than or equal to 1 and n!=1(for n=0) Perform the following 1.write a c program that reads a non-negative integer and computes and prints its factorial. 2. write a C program that estimates the value of the mathematical constant e by using the formula: e=1+1/!+1/2!+1/3!+.... 3. write a c program the computes the value ex by using the formula ex=1+x/1!+xsquare/2!+xcube/3!+....
please give me a VIRTUSA sample palcement papers.... you will only send TECHNICAL SECTION..... that is help for me Advance Thanks........................
Explain function?
What is external variable in c?
Describe the steps to insert data into a singly linked list.
Write the test cases for checking a variable having value in range -10.0 to +10.0?
What is wrong in this statement? scanf(ā%dā,whatnumber);
Write program to remove duplicate in an array?
Can math operations be performed on a void pointer?