Monday, May 5, 2008

printing table in c++

Write a program to print all the tables between 2 and 20 upto 10.


PROGRAM:


#include <iostream.h>

#include <conio.h>


void main() {

clrscr();

for(int j=2;j<=20;j++) {

for(int i=1;i<=10;i++) {

cout<<j<<" X "<<i<<" = "<<j*i<<"\n";

}

cout<<"\n";

}

getch();

}//end of the program

No comments: