Question:

I need a basic C++ program that adds..?

by Guest60875  |  earlier

0 LIKES UnLike

A basic C++ program that does addition, where can I find one?

 Tags:

   Report

6 ANSWERS


  1. include <iostream>

    using namespace std;

    ing main(){

    int a;

    int b;

    cin>>a;

    cin>>b;

    cout<<(a+b);

    return 0;

    }


  2. You can use this code:

    #include <iostream>

    using namespace std;

    int a=0;

    int b=0;

    int c=0;

    int main()

    {

    cout<<"Enter the first number: ";

    cin>>a;

    cout<<"Enter the second number: ";

    cin>>b;

    c=a+b;

    cout<<"The sum is "<<c<<".";

    cin.get();

    }

    Put that in a CPP file and then compile as a Windows console application. When it is done compiling, go open the EXE and it should work.

  3. Are you sure you know what your asking?

  4. u wnat to add 2 numbers simply or wid use of class  

  5. ?

    It already has it built in, just add together whatever your variables or numbers are.

  6. include <iostream.h>

    #include<conio.h>

    void main()

    {

       float num1,num2,sum=0.0;

       clrscr();

       cout << "Input the numbers to be added :";

       cin >> num1 >>num2;

       cout << "\nThe sum is =" << sum;  

       getch();

    }

Question Stats

Latest activity: earlier.
This question has 6 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.
Unanswered Questions