|
-
May 7th, 2009, 06:42 AM
#5
Re: Half of program not showing up in console
 Originally Posted by Cobrah
Ok, im programming a program to help my little sister with her maths and have of the program doesnt show up in the console when I go to compile.
Line 43 and below are the ones that do not show up on screen.
If someone could help me with this, it would be greatly appreciated
Code:
//Fraction Divider
#include <iostream>
#include <stdlib.h>
using std::cout;
using std::cin;
int main()
{
int firstNum, firstDen, secondNum, secondDen, multiplyOne, multiplyTwo;
cout << "\t\tWelcome to Fraction Divider\n\n";
cout << "Please only insert IMPROPER FRACTIONS\n\n";
cout << "Insert NUMERATOR of first fraction:";
cin >> firstNum;
cout << "Insert DENOMINATOR of first fraction:";
cin >> firstDen;
cout << "\nInsert NUMERATOR of second fraction";
cin >> secondNum;
cout << "Insert DENOMINATOR of second fraction";
cin >> secondDen;
cout << firstNum;
cout << "\n--\n";
cout << firstDen;
cout << "\n";
cout << "\tDivided by\n\n"
cout << secondNum;
cout << "\n--\n";
cout << secondDen;
cout << "\n";
cout << "\n\nIf that is correct, see below. If not, restart the program\n\n";
// THE PROBLEM MENTIONED IN FORUMS BEGIN HERE!
// ALl TEXT FOLLOWING THESE COMMENTS FAIL TO SHOW UP!
cout << "To divide fractions, we invert the second fraction and mulitply the new sum\n\n";
cout << "Now we have\n\n";
cout << firstNum;
cout << "\n--\n";
cout << firstDen;
cout << "\n";
cout << "\nMultiplied by\n\n";
cout << secondDen;
cout << "\n--\n";
cout << secondNum;
cout << "\n";
multiplyOne = (firstNum * secondDen);
multiplyTwo = (firstDen * secondNum);
cout << firstNum << "\tMultiplied by\t" << secondDen << "\t = \t" << multiplyOne << "\n" << endl;
cout << firstDen << "\tMultiplied by\t" << secondNum << "\t = \t" << multiplyTwo << "\n\n" << endl;
cout << "Answer:\n\n";
cout << multiplyOne;
cout << "\n--\n";
cout << multiplyTwo;
cout << "\n"
system("pause");
return 0;
}
Thanks
Cobrah
You're missing semi-colons (I have listed where they are). It shouldn't even compile..
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|