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
here's what i have as my pythagorean code for now
#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
but i need to display only the upper right side of the triangle and how to get my following questions