Search This Blog

Friday, 15 May 2020

programming C(values)

   swap the values and display the output


#include <stdio.h>
#include <stdlib.h>

int main()
{
    int X,y,temp;

    printf("Enter number for the first variable\n");
    scanf("%d",&X);

    printf("enter number for the second variable\n");
    scanf("%d",&y);

    temp=X;
    X=y;
    y=temp;

    printf("first variable value %d \n",X);
    printf("second variable value %d \n",y);

    return 0;
}

    

No comments:

Post a Comment

please wait...