How to write a program for swapping two strings without
using 3rd variable and without using string functions.

Answer Posted / sri

main()
{
int a=5,b=3;
a=a+b;
b=a-b;
a=a-b;
printf(" %d %d ",a,b);
getch();
}

Is This Answer Correct ?    33 Yes 42 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to write a c program to print list of fruits in alpabetical order?

1802


Where are c variables stored in memory?

601


Why is c fast?

612


What is a void pointer in c?

613


What does the c preprocessor do?

626






Explain output of printf("Hello World"-'A'+'B'); ?

983


What is storage class?

660


find the sum of two matrices and WAP for it.

642


Why ca not I do something like this?

595


Write a program to generate random numbers in c?

668


Why doesnt that code work?

604


Write a C program in Fibonacci series.

641


Explain is it valid to address one element beyond the end of an array?

743


Write a C program linear.c that creates a sequence of processes with a given length. By sequence it is meant that each created process has exactly one child. Let's look at some example outputs for the program. Here the entire process sequence consists of process 18181: Sara@dell:~/OSSS$ ./linear 1 Creating process sequence of length 1. 18181 begins the sequence. An example for a sequence of length three: Sara@dell:~/OSSS$ ./linear 3 Creating process sequence of length 3. 18233 begins the sequence. 18234 is child of 18233 18235 is child of 18234 ........ this is coad .... BUt i could not compleate it .....:( #include #include #include #include int main(int argc, char *argv[]) { int N; pid_t pid; int cont; if (argc != 2) { printf("Wrong number of command-line parameters!\n"); return 1; } N = atoi(argv[1]); printf("Creating process sequence of length %d.\n",N); printf("%d begins the sequence.\n",getpid()); /* What I have to do next ?????? */ }

1622


Explain Basic concepts of C language?

652