Logo 
Search:

C Programming Articles

Submit Article
Home » Articles » C Programming » Homework HelpRSS Feeds

PROGRAM TO READ NUMBERS, N1 AND N2 ARE INTERCHANGE WITHOUT USING EXTRA VARIABLES.N1=10, N2=20 THEN O/P IS N1=20, N2=10 USING MULTIPLICATION, DIVISION

Posted By: Christine Roberts     Category: C Programming     Views: 3549

WRITE A PROGRAM TO READ TWO POSITIVE NUMBERS, SAY N1 AND N2 ARE INTERCHANGE WITHOUT USING ANY EXTRA VARIABLES.N1=10, N2=20 THEN OUTPUT IS N1=20, N2=10 BY THE MULTIPLICATION (*) AND DIVISION (/).

Code for PROGRAM TO READ NUMBERS, N1 AND N2 ARE INTERCHANGE WITHOUT USING EXTRA VARIABLES.N1=10, N2=20 THEN O/P IS N1=20, N2=10 USING MULTIPLICATION, DIVISION in C Programming

#include<stdio.h>
#include<conio.h>
    void main()
    {
        int a,b;
        clrscr();
        printf("\n Enter The Value of A: ");
        scanf("%d",&a);
        printf("\n Enter The Value of B: ");
        scanf("%d",&b);

        a = a*b;
        b = a/b;
        a = a/b;
        clrscr();
        printf("\n\t\t According to *,/ sign : \n");
        printf("\n\t\t Value of A %d ",a);
        printf("\n\t\t Value of B %d ",b);

        getch();
    }



****************************** INPUT *********************************

     Enter The Value of A: 45

     Enter The Value of B: 25


****************************** OUTPUT *********************************

                 According to  sign :

                 Value of A 25
                 Value of B 45


************************************************************************
  
Share: 



Christine Roberts
Christine Roberts author of PROGRAM TO READ NUMBERS, N1 AND N2 ARE INTERCHANGE WITHOUT USING EXTRA VARIABLES.N1=10, N2=20 THEN O/P IS N1=20, N2=10 USING MULTIPLICATION, DIVISION is from Hartford, United States.
 
View All Articles

Related Articles and Code:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!