bsc

Comprehensive codebase and cou...
Log | Files | Refs | Activity | README | LICENSE

root / semester_1 / letusc / luc009.c

luc009.c (663B)


      1 /* Two numbers are input through the keyboard into two locations
      2 C and D. Write a program to interchange the contents of C and D. */
      3 /* Let Us C, Chap - 2, Page - 37, Qn No.: G(d) */
      4 
      5 #include <stdio.h>
      6 int main()
      7 {
      8     double a, b;
      9     printf("Enter the two number A and B : ");
     10     scanf("%lf %lf", &a, &b);
     11     printf("\nBefore Interchange : ");
     12     printf("\nA = %g (Memory location = %p)", a, &a);
     13     printf("\nB = %g (Memory location = %p)", b, &b);
     14     a = a + b;
     15     b = a - b;
     16     a = a - b;
     17     printf("\nAfter Interchange :");
     18     printf("\nA = %g (Memory location = %p)", a, &a);
     19     printf("\nB = %g (Memory location = %p)", b, &b);
     20     return 0;
     21 }
© notamitgamer • Site Built: 2026-09-05 01:53:16 UTC • git-mirror commit: c170d72 [view raw info]
Originally created with stagit • modified by notamitgamer
Forked from github.com/notamitgamer/git-mirror