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

Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Aug 2006
Posts: 9
Reputation: tln26 is an unknown quantity at this point 
Solved Threads: 0
tln26 tln26 is offline Offline
Newbie Poster

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

 
-1
  #1
Aug 20th, 2006
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.

  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
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 749
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

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

 
0
  #2
Aug 20th, 2006
> cout<<endl
Until you fix ALL the compilation errors, you cannot debug your program.

Also, you use /n where you probably mean \n
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC