944,070 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Marked Solved
  • Views: 925
  • C++ RSS
Aug 20th, 2006
-1

C++ program help please........

Expand Post »
I am having difficulty running this program. I am using Windows XP along with Microsoft Visual Studio.Net 2003.

The error message I get is:
Unable to start debugging system could not find exe.file
Error: C2109
Fatal Error: C1075

I need to use a while loop to take the number that the user inputs and add that number to all the numbers that preceed it and output the sum of the numbers.

C++ Syntax (Toggle Plain Text)
  1. // 3 2.cpp : Defines the entry point for the console application.
  2. //#include "stdafx.h"
  3. #include <iostream>
  4. using std::cin;
  5. using std::cout;
  6. using std::endl;
  7.  
  8.  
  9. int _tmain(int argc, _TCHAR* argv[])
  10. {int sum=0;
  11. int count=0;
  12.  
  13. cout<< "This program will take any number you enter,/n then it will add all numbers leading up to this number /n
  14. to include the number giving you the sum./n Please enter a number";
  15. cin>>count;
  16.  
  17. for(int i=1;i<=count;i++)
  18. sum+=i;
  19.  
  20. cout<<endl
  21. <<"The sum of the numbers 1 to "<<count
  22. <<"is "<<sum<<endl;
  23.  
  24. return 0;
  25. }

Thanks for your help!
T
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
tln26 is offline Offline
9 posts
since Aug 2006
Aug 20th, 2006
0

Re: C++ program help please........

> cout<<endl
Until you fix ALL the compilation errors, you cannot debug your program.

Also, you use /n where you probably mean \n
Team Colleague
Reputation Points: 5862
Solved Threads: 950
Posting Sage
Salem is offline Offline
7,164 posts
since Dec 2005

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Float Help
Next Thread in C++ Forum Timeline: help me plzzz..Turbo C





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC