Monday 19 September 2016

DS-LAB(TABLE FO A NO.)EXPERIMENT-6

ALGORITHM

multi_table()
step1:start
step2:intilize y<-x i="" p="">step3:check whether i<= n,then go to step 4
else go to step 8
step4:print x,i,y
step5:y=y+x
step6:i=i+1
step7:go to step 3
step8:stop
main()
step1:start
step2:read num,limit
step3:call multi_table(num,limit)
step4:stop


FLOWCHART
Image result for flowchart to print multiplication table

PROG

Source Code to Display Multiplication table up to 10

#include <iostream>
using namespace std;

int main() {
    int n;
    cout << "Enter an integer: ";
    cin >> n;
    for (int i = 1; i <= 10; ++i) {
        cout << n << " * " << i << " = " << n*i << endl;
    }
    
    return 0;
}

No comments:

Post a Comment