1. ## Pythagorean Numbers

hey i really need help, how can i generate a simple coding of pythagorean table where it reads the upper right triangle? together, how to get table parameters, use nested loops (which prints out the raw list of all Pythagorean-candidates (do not need to store in an array) & how to extract the pythagorean numbers? i would really really apreciate it, thanks y'all very much for support

2. Originally Posted by NightLightSky
how can i generate a simple coding of pythagorean table where it reads the upper right triangle?
Originally Posted by NightLightSky
how to get table parameters
Originally Posted by NightLightSky
use nested loops (which prints out the raw list of all Pythagorean-candidates (do not need to store in an array)
Originally Posted by NightLightSky
how to extract the pythagorean numbers?

3. ## my pythagorean code for now

Code:
```#include <iostream>
#include <iomanip>
#include <math.h>
using namespace std;
int main()
{
int m, mm;
double xm;
int i, j;
int c;

//Get candidate-table dimensions
cout << "This program generates Pythagorean candidate numbers in a table.\n\n";
cout << "Type the absolute P-candidate maximum M:\n";
cin  >> m;

xm = m+1;
mm = sqrt(xm/2.);
cout << "The row/column size of the candidate table is: " << mm << "\n\n\n";

for( j = 2; j < mm; j++ )
{
cout << setw(5) << j;
}
cout << "\n\n";

//Generates table
for( i = 1; i < mm - 1; i++ )
{
cout << "R= " << setw(2) << i;

for( j = 2; j <= i; j++ )
{
c = (( i * i ) + ( j * j ));
cout << setw(5) << c;
}
cout << "\n";
}
cout << endl;

system( "Pause" );
return 0;
}	//end main```

4. ## upper

but what i need is to display on the upper right side

5. to me:
how can i generate a simple coding of pythagorean table where it reads the upper right triangle?
is something different than:
what i need is to display on the upper right side
the first one seems like its some math thing that i dont know about ("upper right triangle"), the second one seems that you want some output to be right-aligned from the top of the screen. in this case, you have to figure out the "padding" (filling your output with spaces or some other character in order to make it look the way you want).

say your monitor is N characters wide, and we have a character string of length K to print. how do you get this to appear "right-aligned"? N-K spaces (" ") followed by your output. for example, for an output line width of 5 and with string "abc" like (top line is column number:
Code:
```12345
abc```
if you do it this way, you would have to know how wide the output screen is (terminal or console window), because it isnt a fixed size. i dont do stuff like this and im not familiar with this tool, but i think "ncurses" may work.