title: Problems in my code concerning while loop and arrays
body: <p>I was asked to do a program segment on these questions. </p>
  
  <ol>
  <li>That displays the last element of each row contained in Int A[20][50], Use While loop.</li>
  <li>That allocates an array D storing the square of integers from 1 to N.</li>
  <li>A while loop that determines the product of all odd integers from A to B exclusively.</li>
  </ol>
  
  <h1>1</h1>
  
  <pre><code>While(a&lt;20){
  a++
  cout&lt;&lt; A[a][50]&lt;&lt;"\n";
  }
  </code></pre>
  
  <p>edit 1:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  using namespace std;
  int main()
  {
  int a,n,m;
  int  A [20][50]={};
  a=1;
  cout&lt;&lt;"enter your number:"&lt;&lt;endl;
  cin&gt;&gt;n;
  cin&gt;&gt;m;
  cout &lt;&lt;A [n][m] &lt;&lt;"\n";
      while (a&gt; 20){
           cout &lt;&lt; A [a][49]&lt;&lt;"\n";
  }
      system ("pause");
      return 0;
  </code></pre>
  
  <p>edit 2:</p>
  
  <pre><code> #include &lt;iostream&gt;
      #include &lt;string&gt;
      using namespace std;
      int main()
      {
      int a,n,m;
      int  A [20][50]={};
      a=1;
      cout&lt;&lt;"enter your number:"&lt;&lt;endl;
      cin&gt;&gt;n;
      cin&gt;&gt;m;
      cout &lt;&lt;A [n][m] &lt;&lt;"\n";
          while (a &lt; 20){
  
               cout &lt;&lt; A [a][49]&lt;&lt;"\n";
              }
               a++;
         }
          system ("pause");
          return 0;
        }
  </code></pre>
  
  <h1>2</h1>
  
  <pre><code>float num; float d[num];
   cout&lt;&lt;"How many number do you want to enter to find there squure?"&lt;&lt;endl;
   cin&gt;&gt;num;
   for(int i; i&lt;num; i++){
   cin&gt;&gt;d[i];}
  for(int i; i&lt;num; i++) {
  result[i]=d[i]*d[i];}
   for(int i=0; i&lt;num i++){
   cout&lt;&lt;result[i];
  </code></pre>
  
  <p>edit 1</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include&lt;iomanip&gt;
  using namespace std;
  int main()
  {
  int b;
  int x;
  int A[]={};
  int N;
  int n;
     cout &lt;&lt;"enter value for N:"&lt;&lt;endl;
     cin&gt;&gt;N;
  x=1;
  n=N;
  while (x&lt;=N){
     b =x*x;
  A[n]=b;
    x++ ;
  }
  cout &lt;&lt;A[n]&lt;&lt;"\t";
      system ("pause");
      return 0;
  }
  </code></pre>
  
  <p>edit 2</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  using namespace std;
  int main()
  {
    int x=1,b;
    int N=5;
    while (x&lt;=N){
      b=x*x;
  cout&lt;&lt;b&lt;&lt;"\n";
  x++;
  }
  system("pause");
  return 0;
  }
  </code></pre>
  
  <h1>3</h1>
  
  <p>I have no idea on how i can do it :(</p>
  
  <p>Are these codes correct? except number 3 cause I have really have no idea how to do it. 
  can anyone correct these? Thank you very much :)</p>
  
  <p>edit: I made a new answer to number 1 and made compilable :) 
  edit: I edited my number 2 now. But can't seem to get it printed into an array. 
  edit: Was able to make #2 work but I'm sure if It's the output being asked :s</p>