Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 arrays can be passed to a user defined function

1069


Take an MxN matrice from user and then sum upper diagonal in a variable and lower diagonal in a separate variables. Print the result

1944


Explain what is a stream?

1143


What are actual arguments?

1156


Can you mix old-style and new-style function syntax?

1154


Explain what could possibly be the problem if a valid function name such as tolower() is being reported by the c compiler as undefined?

1066


Which header file should you include if you are to develop a function which can accept variable number of arguments?

1462


What are the advantages of using linked list for tree construction?

1145


What is c programming structure?

1277


How can I send mail from within a c program?

1076


What are header files why are they important?

1153


How can I run c program?

1232


What is the difference between a function and a method in c?

1133


Write a program to reverse a given number in c language?

1163


Is boolean a datatype in c?

1128