Two numbers are input through the keyboard into two locations C and D. write a program to interchange the content of C and D. - Code With Friends

Breaking

Home Top Ad

Search Your Questions

Wednesday, February 20, 2019

Two numbers are input through the keyboard into two locations C and D. write a program to interchange the content of C and D.

#include<stdio.h>
int main()
{
    int c,d;
    printf("Enter your c value \n");
    scanf("%d",&c);
    printf("Enter your d value \n");
    scanf("%d",&d);
    c=d;
    d=c;
    printf("Your c value is %d\n",c);
    printf("Your d value is %d\n",d);

}






4 comments:

  1. This program is so wrong
    still uploading it so confidence
    Have some Shame !

    ReplyDelete
    Replies
    1. there you go...right one
      #include
      int main()
      {
      int c,d,e;
      printf("Enter your c value \n");
      scanf("%d",&c);
      printf("Enter your d value \n");
      scanf("%d",&d);
      e=c;
      c=d;
      d=e;
      printf("Your c value is %d\n",c);
      printf("Your d value is %d\n",d);

      }

      Delete
  2. #include
    #include
    int main()
    {
    int a,b,c,d;
    printf("Enter Value of C: ");
    scanf("%d",&c);
    printf("Enter value of D: ");
    scanf("%d",&d);
    a=c;
    b=d;
    c=b;
    d=a;
    printf("\nValue of C: %d \nValue of D: %d",c,d);

    getch();
    return 0;
    }

    ReplyDelete