> ///some tasks ;
Read this ->
http://www.sscce.org/
At least try to convey some sense of what you're trying to achieve, preferably something that actually demonstrates the problem.
A for loop + "it doesn't work" is not going to give you direct answers. Only hand waving and wild guesses.
> D is shown as grey , however, kk is dark black.
Completely meaningless without knowing your colour scheme of your IDE.
> cout << "for" << kk << "=" << Func1(kk, D);
If Func1 also calls cout, then you have undefined behaviour.
Meaning anything can happen.
Better to do
1 2
|
double result = Func1(kk, D);
cout << "for" << kk << "=" << result << endl;
|
Also, not outputting a '\n' or endl means your entire output appears on a single line. Depending on your apparent terminal width, all the other output will disappear to the right, perhaps giving the illusion of a single iteration.
You also pass kk by non-const reference, so if Func1 changes kk to be larger than K, then your loop will also exit after one iteration.