Re: Problems with a program
From: Johnny Lange (JohnnyLange_at_discussions.microsoft.com)
Date: 09/01/04
- Next message: DotNetJunkies User: "Unexpected error writing metadata to file"
- Previous message: Peter van der Goes: "Re: Problems with a program"
- In reply to: Peter van der Goes: "Re: Problems with a program"
- Next in thread: Peter van der Goes: "Re: Problems with a program"
- Reply: Peter van der Goes: "Re: Problems with a program"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 31 Aug 2004 19:51:04 -0700
Thanks for the help! I took back that book, because it didn't really explain
pointers and strings very well. Perhaps it's more for someone who experienced
with programing. So I picked up... How to program C++, fourth edition, by
Deitel. It's just native C++, (not MC++) I figured it might be better just to
learn "unmanged" C++ code first, then switch to MC++. I took one of the
figure examples in the book, edited it to make the program I was orignally
trying to make in MC++. The book explains everything much better, I actually
understand the stuff...lol
The following is working source code:
// Fig. 1.6:
// This program was edited to include some extras from the book
// "How to program C++ ,4th Edition" by Deitel
#include <iostream>
int main()
{
int integer1;
int integer2;
int sum;
int difference;
int product;
int quotient;
int modulation;
std::cout << "Enter first integer\n";
std::cin >> integer1;
std::cout << "Enter second integer\n";
std::cin >> integer2;
sum = integer1 + integer2;
difference = integer1 - integer2;
product = integer1 * integer2;
quotient = integer1 / integer2;
modulation = integer1 % integer2;
std::cout << "Sum is\n " << sum << std::endl;
std::cout << "difference is\n " << difference << std::endl;
std::cout << "product is\n " << product << std::endl;
std::cout << "quotient is\n " << quotient << std::endl;
std::cout << "modulation is\n " << modulation << std::endl;
return 0;
}
- Next message: DotNetJunkies User: "Unexpected error writing metadata to file"
- Previous message: Peter van der Goes: "Re: Problems with a program"
- In reply to: Peter van der Goes: "Re: Problems with a program"
- Next in thread: Peter van der Goes: "Re: Problems with a program"
- Reply: Peter van der Goes: "Re: Problems with a program"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|