bsc

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

luc009.c (799B)


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