Alright, I have a loop with a few nested loops inside like so:
........
for (int s=0; s<200; s++)
{
for (int i=0; i<N_plates; i++)
{
for (int j=0; j<3; j++)
{
V=V+(Cen[i][j])*(N[i][j]);
}
for (int j=0; j<3; j++)
{
................
}
}
V=V/6;
cout << "Volume:" << V << endl;
}
Alright, so the problem I am having with this is that I only want "V" to print once to the screen. However, its printing as many times as the primary loop tells it too.
The only way around this that I have in mind is to set this "V" as an array and tell it to print it once.
Is there any other way to get it to print once without having to write it as an array or changing the structure of the program.
Thanks