0

please help me.... i need some help on how to get the grades of this program and also can u please correct it... cause i think something is not right...

#include<iostream.h>

int A[5];
int ctr;

main()
{
   ctr=5;
   while(ctr<5);
   {
      cin>>A[ctr];
      ctr=ctr +1;
   }
   cout<<A[5];

   ctr=5;
   do
   {
      cout<<A[ctr];
      ctr=ctr +1;
   }
    while(ctr<=4);

    for(ctr=0; ctr<=4; ctr++)
        cout<<A[ctr];
}

can u please make it right and with a value of grades....

Edited by Reverend Jim: Fixed formatting

3
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by alaa sam
0

I believe this version of your program will at least compile:

#include<iostream>
using namespace std;

int A[5];
int ctr = 0;

int main()
{
     ctr = 5;

     while(ctr < 5);
     {
          cin >> A[ctr];
          ctr++;
     }

     cout << A[5];

     ctr = 5;

     do
     {
          cout << A[ctr];
          ctr++;

     }while(ctr <= 4);

     for(ctr = 0; ctr <= 4 ; ctr++)
     {
          cout<<A[ctr];
     }

return 0;
}
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.