Write a program to interchange two variables without using
the third variable?
Answers were Sorted based on User's Feedback
#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 |
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 |
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 |
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 |
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 |
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 |
#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 |
Design a program using an array that searches a number if it is found on the list of the given input numbers and locate its exact location in the list.
Want to know how to write a C program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.
What is the difference between int and float?
How would you rename a function in C?
what is the difference between #include<> and #include”…”?
How can you find out how much memory is available?
what are threads ? why they are called light weight processes ? what is the relation between process and threads ?
What is the difference between Printf(..) and sprint(...) ?
please explain clearly about execution of c program in detail,in which stage are the printf sacnf getting into exeecutable code
difference between ordinary variable and pointer in C?
What is a static variable in c?
wap in c to accept a number display the total count of digit