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

Explain what is gets() function?

633


What are the advantages of Macro over function?

1204


What is the purpose of void in c?

619


Tell me can the size of an array be declared at runtime?

599


Write a program to swap two numbers without using third variable?

814






What is an arrays?

653


int far *near * p; means

3121


What is function what are the types of function?

560


What is the collection of communication lines and routers called?

614


Dont ansi function prototypes render lint obsolete?

604


what is ur strangth & weekness

1820


Implement bit Array in C.

676


What does %c do in c?

584


Write a program to show the change in position of a cursor using c

581


c language supports bitwise operations, why a) 'c' language is system oriented b) 'c' language is problem oriented c) 'c' language is middle level language d) all the above

614