Logo 
Search:

C++ Programming Articles

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

Program to add two numbers

Posted By: Blasa Fischer     Category: C++ Programming     Views: 17221

Write a program to add two numbers.

Code for Program to add two numbers in C++ Programming

# include <iostream.h>
# include <conio.h>

int main()
{
    clrscr();
    int i,j,k;
    int add(int ,int);
    cout<<"\nENTER THE VALUE FOR THE FIRST VARIABLE:->";
    cin>>i;
    cout<<"\nENTER THE VALUE FOR THE SECOND VARIABLE:->";
    cin>>j;
    k=add(i,j);
    cout<<"\nTHE SUM IS :->"<<k;
    getch();
    return 0;
}

int add(int i,int j)
{
    return i+j;
}
  
Share: 


Didn't find what you were looking for? Find more on Program to add two numbers Or get search suggestion and latest updates.

Blasa Fischer
Blasa Fischer author of Program to add two numbers is from Frankfurt, Germany.
 
View All Articles

 

Other Interesting Articles in C++ Programming:


 
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!