Thread: Noob here, having trouble with simple program

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Sep 2016
    Posts
    4

    Unhappy Noob here, having trouble with simple program

    Hi, new programmer here, having trouble with very simple assignment, everytime i run this program it keeps printing zero as the average.




    int main()
    {
    int numExercises, totalScore = 0, pointsPossible = 0;
    bool condition = true;

    cout << "Score received for exercise N: ";
    cin >> totalScore;
    cout << "Total points possible for exercise N: ";
    cin >> pointsPossible;


    cout.setf(ios::fixed);
    cout.setf(ios::showpoint);
    cout.precision(4);

    cout << "Your average is " << totalScore / pointsPossible;

    return 0;



    can anyone tell me whats wrong with it?
    Last edited by NoobMan; 09-19-2016 at 10:09 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 02-21-2011, 10:21 PM
  2. Replies: 1
    Last Post: 04-12-2009, 04:21 AM
  3. noob help on simple program
    By halfpint101 in forum C++ Programming
    Replies: 3
    Last Post: 12-18-2007, 07:29 PM
  4. Replies: 2
    Last Post: 11-17-2007, 04:25 PM
  5. Having trouble with a simple program......
    By Redpred in forum C Programming
    Replies: 9
    Last Post: 08-11-2006, 04:39 AM

Tags for this Thread