Priniting Reverse tables using Goto Statement in C++


Example Program:

Here is the simple program for printing reverse tables within limit using Goto Statement in C++.

Source Code

#include<iostream>
using namespace std;
int main()
{
    int n,a;
    cout<<"\nEnter the limit :";
    cin>>n;
    cout<<"\nEnter the table's number:";
    cin>>a;
    start:
        cout<<"\n"<<n<<"*"<<a<<"="<<n*a;
        n--;
        if(n>0)
        {
            goto start;
        }
    return 0;
}
To download raw file Click Here

Output

Enter the limit :10
Enter the table's number:2
10*2=20
9*2=18
8*2=16
7*2=14
6*2=12
5*2=10
4*2=8
3*2=6
2*2=4
1*2=2

Basic Programs


Flow Control

IF Statement Examples


Switch Case

Goto Statement

Break and Continue

While Loop

Do While Loop

For Loop

Friend Function in C++


String Examples


Array Examples


Structure Examples


Structure & Pointer Examples


Structure & Functions Examples


Enumeration Examples


Template Examples


Functions


List of Programs


Pointer Examples


Memory Management Examples


Pointers and Arrays


Virtual Function Examples



Learn All in Tamil © Designed & Developed By Tutor Joes