Sunday 10 June 2012

code of c++ for table






This is the code for writing table by using c++

#include<iostream.h>
main()
{
      int counter,number,maxmultipiler;
      cout<<"please enter the value for which you want a table:";
      cin>>number;
      cout<<"please enter the value up to which you want the table:";
      cin>>maxmultipiler;
      for(counter=1;counter<=maxmultipiler;counter=counter+1)
      {
      cout<<number<<"x"<<counter<<"="<<number*counter<<"\n";
      }
   system("pause");
      }

End

1 comment: