0

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.

3
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by KasmIR
0

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 :)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.