as the title suggest i like to swap two numbers but the thing is that i should not use 3rd variable that is doing the whole stuff only with 2 variables so plz any body help me out
chillharsh
0
Newbie Poster
Recommended Answers
Jump to PostAre you reading How to Program for the 1970's?
Googling will get you the answer you are seeking, but then after you know it, don't ever use it for programming today or in the future -- use a temporary variable. Solving yesterday's problems today is useful to understand the …
Jump to Post> ya thaxs it works
Rather too easy to break IMO#include <stdio.h> int swap ( int *a, int *b ) { *a ^= *b; *b ^= *a; *a ^= *b; } int main(void) { int a = 2, b = 3; printf( "%d %d\n", a, b …
All 7 Replies
Dave Sinkula
2,398
long time no c
Team Colleague
Laiq Ahmed
42
Junior Poster
Dave Sinkula
2,398
long time no c
Team Colleague
chillharsh
0
Newbie Poster
Dave Sinkula
2,398
long time no c
Team Colleague
Salem
5,138
Posting Sage
sukhi
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.