a C prog to swap 2 no.s without using variables just an
array?

Answer Posted / laxmi bose

#include<stdio.h>
main()
{
int a[0],a[1],a[2];
scanf("%d%d",&a[0],&a[1]);
a[2]=a[0];
a[0]=a[1];
a[1]=a[2];
printf("%d,%d",a[0],a[1]);
}

Is This Answer Correct ?    11 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how do you execute a c program in unix.

634


What are the c keywords?

744


Can we increase size of array in c?

534


what is the height of tree if leaf node is at level 3. please explain

1591


Simplify the program segment if X = B then C ← true else C ← false

2577






Should I learn c before c++?

593


Is c still used?

598


What is pointer in c?

731


Is null valid for pointers to functions?

603


Which is not valid in C a) class aClass{public:int x;}; b) /* A comment */ c) char x=12;

603


What is data structure in c language?

599


write a progrmm in c language take user interface generate table using for loop?

1571


What are the different types of control structures?

576


What is the difference between array and linked list in c?

593


What is the explanation for cyclic nature of data types in c?

640