1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | #include<iostream.h> #include<conio.h> int value=1,p,i; int limit; class multiplication { public: void read() { cout<<"Enter limit of multiplication displayed\n"; cin>>limit; } void calculate() { for(i=1;i<=10;i++) { p=(value*i); cout<<i<<"x"<<value<<"="<<p<<"\n";; } } void next() { if(value<limit) { cout<<"\n"; value++; calculate(); next(); } } }; void main() { multiplication s; clrscr(); s.read(); s.calculate(); s.next(); getch(); } |
Search This Blog
Friday, 29 November 2013
DISPLAY MULTIPLICATION FROM 1 to ANY LIMIT.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment