Logo 
Search:

C Programming Articles

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

Program to inter change to number in each other

Posted By: Hedwig Miller     Category: C Programming     Views: 2415

Write a program to inter change to number in each other.

Code for Program to inter change to number in each other in C Programming

#include<stdio.h>
void main()
{
int number1,number2,number3;

        printf("enter the first number");
        if(scanf("%d",&number1)==1)
        {
                printf("enter the second number");
                if(scanf("%d",&number2)==1)
                {
                number3=number2;
                number2=number1;
                number1=number3;
                printf("number1=%d\n",number1);
                printf("number2=%d\n",number2);
                }
                else
                {
                        printf("Error,Enter the number in decimal data type.");
                }
        }


===============================OUTPUT==================================

enter the first number232
enter the second number23
number1=23
number2=232
  
Share: 


Didn't find what you were looking for? Find more on Program to inter change to number in each other Or get search suggestion and latest updates.

Hedwig Miller
Hedwig Miller author of Program to inter change to number in each other is from Frankfurt, Germany.
 
View All Articles

 
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!