This program prints out the multiplication table of a given number up to a certain limit using a goto statement. Here's how the program works:
While this program works correctly, using a goto statement is generally not considered good programming practice because it can make the code difficult to read and maintain. A better alternative would be to use a for loop to print out the multiplication table
/* i=1 n=10 table=2 1*2=2 2*2=4 3*2=6 */ #include<iostream> using namespace std; int main() { int i=1,n,m,a; cout<<"Enter the limit :"; cin>>n; cout<<"Enter the table's number :"; cin>>a; start: cout<<"\n"<<i<<"*"<<a<<"="<<i*a; i++; if(i<=n) { goto start; } return 0; }To download raw file Click Here
Enter the limit :10 Enter the table's number :9 1*9=9 2*9=18 3*9=27 4*9=36 5*9=45 6*9=54 7*9=63 8*9=72 9*9=81 10*9=90
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions