Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


Write a program to interchange two variables without using
the third variable?

Answers were Sorted based on User's Feedback



Write a program to interchange two variables without using the third variable?..

Answer / ramesh mca gprec knl

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
printf("Enter two no");
scanf("%d%d",&a,&b);
c=a*b;
b=a/b;
a=b/a;
printf("After chanching no is =\n");
printf("a=%d b=%d",a,b);
getch();
}

Is This Answer Correct ?    1 Yes 4 No

Write a program to interchange two variables without using the third variable?..

Answer / kumar

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
printf("Enter two no");
scanf("%d%d",&a,&b);
a=b-0;
b=a-0;
printf("a=%d b=%d",a,b);
getch();
}

Is This Answer Correct ?    0 Yes 4 No

Write a program to interchange two variables without using the third variable?..

Answer / neelam

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf("Enter two no.s 4 swap");
scanf("%d%d",&a,&b);
a=a+b;;
b=a-b;
a=a-b;
printf("After swapping no.s are =\n");
printf("a=%d b=%d",a,b);
getch();
}

Is This Answer Correct ?    0 Yes 4 No

Write a program to interchange two variables without using the third variable?..

Answer / satish

#include<stdio.h>
void main()
{
int x,y;
printf("enter x and y: ");
scanf("%d%d",&x,&y);
x^=y^=x^=y;
printf("elements after swapping: %d,%d\n",x,y);
}

Is This Answer Correct ?    20 Yes 26 No

Write a program to interchange two variables without using the third variable?..

Answer / deepa.n

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf("Enter two no");
scanf("%d%d",&a,&b);
a=a*b;
b=a/b;
a=b/a;
printf("After chanching no is =\n");
printf("a=%d b=%d",a,b);
getch();
}

Is This Answer Correct ?    8 Yes 14 No

Write a program to interchange two variables without using the third variable?..

Answer / deepa.n

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
printf("Enter two no");
scanf("%d%d",&a,&b);
c=a*b;
b=a/b;
a=b/a;
printf("After chanching no is =\n");
printf("a=%d b=%d",a,b);
getch();
}

Is This Answer Correct ?    15 Yes 26 No

Write a program to interchange two variables without using the third variable?..

Answer / mahendra giri

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
printf("Enter two no");
scanf("%d%d",&a,&b);
c=a+b;
b=a-b;
a=a-b;
printf("After chanching no is =\n");
printf("a=%d b=%d",a,b);
getch();
}

Is This Answer Correct ?    23 Yes 44 No

Post New Answer



More C Interview Questions

What are the basic data types associated with c?

0 Answers  


a program that can input number of records and can view it again the record

0 Answers   Accenture,


write a program to print the all 4digits numbers & whose squares must me even numbers?

2 Answers   Virtusa,


There are 21 people in a room. They have to form groups of 3 people each. How many combinations are possible? Write a C program to print the same.

1 Answers   HCL, iGate,


Is c call by value?

0 Answers  






write a program in c to print **** * * * * ****

1 Answers   TCS,


What is structure packing in c?

0 Answers  


What is ## preprocessor operator in c?

0 Answers  


if we take a number as a char then can we manipulate(add, subtract) on this number

2 Answers  


SIR PLS TELL ME THE CODE IN C LANGUAGE TO PRINT THE FOLLOWING SERIES 1 1 2 1 1 2 3 2 1 1 2 3 4 3 2 1 1 2 3 2 1 1 2 1 1

4 Answers  


What is the purpose of the following code? Is there any problem with the code? void send(int count, short *to, short *from) { /* count > 0 assumed */ register n = (count + 7) / 8; switch (count % 8) { case 0: do { *to = *from++; case 7: *to = *from++; case 6: *to = *from++; case 5: *to = *from++; case 4: *to = *from++; case 3: *to = *from++; case 2: *to = *from++; case 1: *to = *from++; } while (--n > 0); } }

0 Answers   Google,


marge linklist

0 Answers   HCL,






Categories