Multi dimentional Arrays.

Write a program to enter data into a table and display on the screen in tabular form. Please check my code below. I want to know where are the errors.
Thanks in advance.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
 #include<iostream>
 using namespace std;
int main()
{
int table[3][4];
int r,c,i;
r=c=0;
while(r<=2)
	{
	for(r=0;r<5;r++)
		cout<<"enter values in rows"<<endl;
		cin>>table[r][c];
	 }
	 r++
	for(i=0;i<5;i++)
	{
		cout<<table[r][c]<<"\t";
		cout<<endl;
		}
getch();
}
shoqi wrote:
I want to know where are the errors.
Did you try compiling it?
http://coliru.stacked-crooked.com/a/5ac930692a3f2baf
main.cpp:15:8: error: expected ';' after expression
    r++
       ^
       ;
main.cpp:21:5: error: use of undeclared identifier 'getch'
    getch();
    ^
2 errors generated.
Also, line 12 is not part of the for loop.
Yes I tried. I am compiling in turbo c++ v4.5. Putted semicolon after r++ still getting errors.

Thanks.
Could you copy and paste the exact errors you are getting?
Topic archived. No new replies allowed.