Hello guys, i need help. I just began to learn c++, and i have a problem. How to write a program, which count numbers in a interval from k to n. I now the program is simple but i just can t bring it to work. Im using the loop for here what i write:
#include <iostream.h>
void main()
{
int suma = 0;
int k;
int n;
int x;
cout << "k";
cin >> k;
cout << "n";
cin >> n;
for ( x = 0; x > k; x < n)
{
cout += x;
x++;
}}
I now the problem is in cout and in x. Can anyone help!