| /*Swap without using
third variable*/
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,t;
clrscr();
printf("\n\tEnter Any First Number :
");
scanf("%d",&a); //input
printf("\n\tEnter Any Second Number :
");
scanf("%d",&b); //input
printf("\n\t**Before Swap**");
printf("\n\ta = %d",a);
printf("\n\tb = %d",b);
a=a+b;
b=a-b;
a=a-b;
printf("\n\t**After Swap**");
printf("\n\ta = %d",a);
printf("\n\tb = %d",b);
getch();
}
|
Output |
Computer Science :: 11th/12th, Computer Engineering :: Degree/Diploma, Coding Concept ( C, C++ & JAVA Programming, JDBC Concept, DBMS - SQL Concept, Data Structure, Communication & Network Concept.
SWAP WITHOUT USING THIRD VARIABLE
Subscribe to:
Posts (Atom)
Programmingway@Eklavya Technosys!: Computer Solutions || Class-4 || Computer for Scho...
Programmingway@Eklavya Technosys!: Computer Solutions || Class-4 || Computer for Scho... : 1) Choose correct one :- 1) The step by step pla...
-
COMPUTER TERMINOLOGY 1) TCP/IP - Transmission Control Protocol/ Internet Protocol. 2) HTTP...
-
https://makecode.com/_3VxaMo6c3YPp Code 1) What is Make Code Arcade? Answer: Make Code Arcade is a Block based coding. 2) Writ...
-
Check whether the number is negative or positive after taking a number as input from the user. TextWindow . WriteLine ( "Ente...
-
1) Choose correct one :- 1) The step by step plan of solution for solving a problem is called ____. a) Algorithm b) Internet c) URL d) M...
-
1) ___ is the response of the receiver after perceiving the message. a) Encoding b) Decoding c) Channel d) Feedback 2) Which of the fo...
No comments:
Post a Comment