Swapping

CODE




Swapping:
Interchange the value of c and d

int main()
{
    float c,d;
    printf("\n Enter c and d:");
    scanf("%f%f",&c,&d);
    c=c+d;
    d=c-d;
    c=c-d;
    printf(“After swapping:\n”);
    printf("\n c=%f and d=%f",c,d);
}


Output:
Enter c and d:
4
6
After swapping:
 c=6 and d=4

Swapping Swapping Reviewed by Unknown on December 13, 2018 Rating: 5

No comments:

If you have any doubt or query ,comment below:

Programming copyright © 2018-19. Powered by Blogger.