WRITE A PROGRAM TO READ TWO POSITIVE NUMBERS, SAY N1 AND N2 ARE INTERCHANGE WITHOUT USING ANY EXTRA VARIABLES.N1=10, N2=20 THEN OUTPUT IS N1=20, N2=10 BY THE MULTIPLICATION (*) AND DIVISION (/).
Code for PROGRAM TO READ NUMBERS, N1 AND N2 ARE INTERCHANGE WITHOUT USING EXTRA VARIABLES.N1=10, N2=20 THEN O/P IS N1=20, N2=10 USING MULTIPLICATION, DIVISION in C Programming
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf("\n Enter The Value of A: ");
scanf("%d",&a);
printf("\n Enter The Value of B: ");
scanf("%d",&b);
a = a*b;
b = a/b;
a = a/b;
clrscr();
printf("\n\t\t According to *,/ sign : \n");
printf("\n\t\t Value of A %d ",a);
printf("\n\t\t Value of B %d ",b);
getch();
}
****************************** INPUT *********************************
Enter The Value of A: 45
Enter The Value of B: 25
****************************** OUTPUT *********************************
According to sign :
Value of A 25
Value of B 45
************************************************************************