swap to number

Discussion in 'C' started by Ziaur Rahman, Oct 26, 2006.

Thread Status:
Not open for further replies.
  1. Ziaur Rahman

    Ziaur Rahman New Member

    Joined:
    Oct 22, 2006
    Messages:
    11
    Likes Received:
    1
    Trophy Points:
    0
    Occupation:
    Student
    Location:
    Pune
    Code:
    #include<stdio.h>
    #include<conio.h>
    #define SWAPE(x,y) int t;t=x;x=y;y=t;
    main()
    {
    int a,b;
    
    Printf("\n Enter two number");
    scanf("%d%d",&a,&b);
    Printf("\n Before swaping the Value of a=%d and b=%d",a,b);
    SWAPE(a,b);
    printf("\n After swap value of a=%d and b=%d",a,b);
    return 0;
    }
     
    Last edited by a moderator: Oct 26, 2006
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Duplicate of [thread=1732]Swap two variables using macro[/thread] article. Thread closed.
     
Thread Status:
Not open for further replies.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice