HOW TO SWAP TWO NOS IN ONE STEP?

Answers were Sorted based on User's Feedback



HOW TO SWAP TWO NOS IN ONE STEP?..

Answer / rahul

Put mirror on SWAP. You can see the reverse on the mirror.

Is This Answer Correct ?    0 Yes 2 No

HOW TO SWAP TWO NOS IN ONE STEP?..

Answer / n.ramesh

#include(stdio.h);
#include(stdlib.h);
void main()
{
int a=10,b=20;
swap(a,b);
a=b&b=a;
printf("%d%d",a,b);
}

Is This Answer Correct ?    3 Yes 8 No

HOW TO SWAP TWO NOS IN ONE STEP?..

Answer / venkatesh sabinkar

#include<stdio.h>
#include<conio.h>
void main()
{
int a=5,b=2,t;
clrscr();
printf("a=%d,b=%d",a,b,b=t,a=b,t=a);
getch();
}

Is This Answer Correct ?    0 Yes 5 No

HOW TO SWAP TWO NOS IN ONE STEP?..

Answer / ashik

#define SWAP(x,y) int t;t=x;x=y;y=t;

Is This Answer Correct ?    2 Yes 10 No

HOW TO SWAP TWO NOS IN ONE STEP?..

Answer / priya

int a=5,b=2;
printf("%d %d");


execute the pgm deftly swap wil tak place.......

Is This Answer Correct ?    3 Yes 12 No

HOW TO SWAP TWO NOS IN ONE STEP?..

Answer / sasa

step 1.
a=b,b=a

Is This Answer Correct ?    0 Yes 35 No

Post New Answer

More C Interview Questions

what is mean by Garbage collection ? Please answer me. Advance thanks.

4 Answers   Excel,


You have given 2 array. You need to find whether they will create the same BST or not. For example: Array1:10 5 20 15 30 Array2:10 20 15 30 5 Result: True Array1:10 5 20 15 30 Array2:10 15 20 30 5 Result: False One Approach is Pretty Clear by creating BST O(nlogn) then checking two tree for identical O(N) overall O(nlogn) ..we need there exist O(N) Time & O(1) Space also without extra space .Algorithm ?? DevoCoder guest Posted 3 months ago # #define true 1 #define false 0 int check(int a1[],int a2[],int n1,int n2) { int i; //n1 size of array a1[] and n2 size of a2[] if(n1!=n2) return false; //n1 and n2 must be same for(i=0;i<n1-1;i++) { if( !( (a1[i]>a1[i+1]) && (a2[i]>a2[i+1]) ) ) return false; } return true;//assumed that each array doesn't contain duplicate elements in themshelves }

0 Answers   Facebook,


Why the below program throughs error during compilation? #include<stdio.h> #include<conio.h> enum { ZERO, ONE, TWO, }; main() { printf("%d",&TWO); getch(); }

2 Answers  


Why do we use namespace feature?

0 Answers  


please explain clearly about execution of c program in detail,in which stage are the printf sacnf getting into exeecutable code

0 Answers   Mind Tree,






what is reason of your company position's in india no. 1.

0 Answers   Accenture, TCS,


At a shop of marbles, packs of marbles are prepared. Packets are named A, B, C, D, E …….. All packets are kept in a VERTICAL SHELF in random order. Any numbers of packets with these names could be kept in that shelf as in this example: bottom of shelf ---> [AAAJKRDFDEWAAYFYYKK]-----Top of shelf. All these packets are to be loaded on cars. The cars are lined in order, so that the packet could be loaded on them. The cars are also named [A, B, C, D, E,………….]. Each Car will load the packet with the same alphabet. So, for example, car ‘A’ will load all the packets with name ‘A’. Each particular car will come at the loading point only once. The cars will come at the loading point in alphabetical order. So, car ‘B’ will come and take all the packets with name ‘B’ from the shelf, then car ‘C’ will come. No matter how deep in the shelf any packet ‘B’ is, all of the ‘B’ packets will be displaced before the ‘C’ car arrives. For that purpose, some additional shelves are provided. The packets which are after the packet B, are kept in those shelves. Any one of these shelves contains only packets, having the same name. For example, if any particular shelf is used and if a packet with name X is in it, then only the packets having names X will be kept in it. That shelf will look like [XXXXXXX]. If any shelf is used once, then it could be used again only if it is vacant. Packets from the initial shelf could be unloaded from top only. Write a program that finds the minimum total number of shelves, including the initial one required for this loading process.

0 Answers   Infosys,


What is character set?

0 Answers  


which one is better structure or union?(other than the space occupied )

2 Answers  


how can you print&scan anything using just one character? :) HINT: printf,scanf similer

2 Answers  


Explain what is the difference between text files and binary files?

0 Answers  


What are the uses of a pointer?

0 Answers  


Categories