HI everyone, like my last post stated I am new to programming so be patient with me. I am having a hell of a time writing this program and I was hoping some of you might be able to give me some quick pointers on the structure I should use. Maybe an example too?

Here's the problem:

Assignment: Write. Compile, test and document a C++ computer program as follows:

Write a C++ program that inputs 2 numbers.
Then, the program should add, subtract, multiple and divide the numbers outputting each mathematical operation as follows: The value of num1 = 8 and the value of num2 = 5 and their addition operation is 12.
Repeat output for the other mathematical operations.

Recommended Answers

All 2 Replies

So what have you got so far?

Hello,

You can read more from here

You request one example.

#include<iostream>
using namespace std;
int main()
{
int num1,num2,result;

cout<<"Enter First number ";
cin>>num1;
cout<<"Enter second number ";
cin>>num2;
result=num1*num2// For multiplication 

cout<<"Multiplication of first and second number is "<<result;

return 0;
}

PS: :) " The value of num1 = 8 and the value of num2 = 5 and their addition operation is 12. " FALSE :) 8+5=13 :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.