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?

Answers were Sorted based on User's Feedback



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

Answer / 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

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

Answer / sankar kiran

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
printf("Enter the number:");
scanf("%d%d",&a,&b)
a=a+b;
b=a-b;
a=a-b;
printf("%d%d",a,b);
getch();

}

Is This Answer Correct ?    14 Yes 7 No

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

Answer / jaspreet singh

void main()
{
int a[2]={20,10};
a[0]=a[0]^a[1];
a[1]=a[0]^a[1];
a[0]=a[0]^a[1];
printf("a=%d,b=%d",a[0],a[1])
getch();
}

Is This Answer Correct ?    7 Yes 4 No

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

Answer / karthik

void main()
{
int a=10,b=20;
a^=b^=a^=b;
printf("a=%d,b=%d",a,b)
getch();
}

Is This Answer Correct ?    8 Yes 6 No

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

Answer / baidyanath bisoyi

void main()
{
int a,b;
printf("enter the two numbers\n");
scanf("%d%d",&a,&b);
printf("a=%d\n b=%d\n",a,b);
a=a+b-(b=a);
printf("a=%d\n b=%d\n",a,b);
getch();
}

Is This Answer Correct ?    4 Yes 3 No

Post New Answer

More C Interview Questions

What is graph in c?

0 Answers  


Write a C Program to display the following menu: Menu 1. Display 2. Copy 3. Append 4. Exit Accept the choice (1-4) from the user, and perform the following tasks: Choice 1: Accept a file name from the user and display the file on screen Choice 2: Accept two file names, and copy first file to the second Choice 3: Accept two file names, and append second file to the first file Choice 4: Terminate the program

1 Answers   Accenture, Concor, DMU, Satyam, Syntel, Tora,


please give me a VIRTUSA sample palcement papers.... you will only send TECHNICAL SECTION..... that is help for me Advance Thanks........................

0 Answers  


which operator having lowest precedence?? a.)+ b.)++ c.)= d.)%

4 Answers  


There are N egg baskets and the number of eggs in each basket is a known quantity. Two players take turns to remove these eggs from the baskets. On each turn, a player must remove at least one egg, and may remove any number of eggs provided they all belong to the same basket. The player picking the last egg(s) wins the game. If you are allowed to decide who is going to start first, what mathematical function would you use to decide so that you end up on the winning side?

8 Answers   Google,


What is the proper way of these job Tell me about there full work

0 Answers   EDS,


What is the c value paradox and how is it explained?

0 Answers  


What are pointers really good for, anyway?

0 Answers  


how to use enum datatype?Please explain me?

3 Answers   Excel,


What is the advantage of c?

0 Answers  


What is nested structure?

0 Answers  


What is line in c preprocessor?

0 Answers  


Categories