PPS Practical 4

PPS Practical 4
  • Aim: Write a C program to interchange two numbers.
  • Code:
    //For turbo C++ remove below comments
    #include <stdio.h>
    //#include<conio.h>
    void main()
    {
        int x,y,z;
        //clrscr();
        printf("Enter First Number x : ");
        scanf("%d",&x);
        printf("Enter Second Number y: ");
        scanf("%d",&y);
        z=x;
        x=y;
        y=z;
        printf("After Swapping x = %d and y = %d",x,y);
        //getch();
    }
                    
  • Output:
  • Output of practical 4

Comments