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.

// 3 2.cpp : Defines the entry point for the console application.
//#include "stdafx.h"
#include <iostream>
using std::cin;
using std::cout;
using std::endl;


int _tmain(int argc, _TCHAR* argv[])
{int sum=0;
int count=0;

cout<< "This program will take any number you enter,/n then it will add all numbers leading up to this number /n
to include the number giving you the sum./n Please enter a number";
cin>>count;

for(int i=1;i<=count;i++)
sum+=i;

cout<<endl
<<"The sum of the numbers 1 to "<<count
<<"is "<<sum<<endl;

return 0;
}

Thanks for your help!
T

Grunt commented: Don't start new thread for same problem +0

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

Also, you use /n where you probably mean \n

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.