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

#define MAX 3 main() { printf("MAX = %d ",MAX ); #undef MAX #ifdef MAX printf("Vector Institute”); #endif }

1 Answers  


Can the “if” function be used in comparing strings?

0 Answers  


c programs are converted into machine language with the help of a) an interpreter b) a compiler c) an operatinf system d) none of the above

0 Answers  


Describe explain how arrays can be passed to a user defined function

0 Answers  


How will you find a duplicate number in a array without negating the nos ?

0 Answers  






Write a program to print factorial of given number without using recursion?

0 Answers  


find the output of the following program main() { int x=5, *p; p=&x; printf("%d",++*p); }

10 Answers   Amdocs, TCS,


What is unary operator?

0 Answers  


How to add two numbers with using function?

4 Answers  


What is the Difference between Class and Struct?

10 Answers   Motorola,


Can u return two values using return keyword? If yes, how? If no, why?

7 Answers  


# define prod(a,b)=a*b main() { int x=2; int y=3; printf("%d",prod(x+2,y-10)); } the output of the program is a.8 b.6 c.7 d.none

7 Answers   Microsoft, TCS,


Categories