Here is what I've written for a program to print upper half triangle of a matrix. Now I need a way to do it without using goto:     #include <iostream>using namespace std;int main(){    int a[10][10], r, c, i, j;    cout << Enter the number of rows and columns;    cin >> r >> c ;    cout << Enter the matrix :;    for(i=0;i<r;++i)    {                    for(j=0;j<c;++j)                    {                                    cin >> a[i][j];                    }    }    cout << The matrix is : \n;    for(i=0;i<r;++i)    {                    for(j=0;j<c;++j)                    {                                    if(j<i)                                    goto loop;                                    cout << a[i][j] << \t;                                    loop:                                         if(j<i)                                         cout<<  \t;                                    if(j==(c-1))                                    cout<<\n;                     }    }    cin >> r;}                           Any help is appreciated.
Print the upper half triangle of a matrix
c++;matrix
The only goto I see is the following:if(j<i)    goto loop;cout << a[i][j] << \t;loop:    if(j<i)         cout<<  \t;if(j==(c-1))    cout<<\n; You can easily change that to a simple if-else:if(j<i) {    cout<<  \t;} else {    cout << a[i][j] << \t;}if(j==(c-1)) {    cout<<\n; }