Comments

Tuesday, August 27, 2013

Find the 15 multiple of any number

Posted by at 2:19 AM Read our previous post


Object:
Find the 15 multiple of any number
Source Code:

#include <iostream>
using namespace std;

class multiple
{
public:

       int number(int num)
       {
      
              int ans=1;
              for(int count=0;count<15;count++)
              {

              ans=ans*num;
             
              }
       return ans;
      
       }
};

void main()
{
       multiple multi;
       int number,ans;
       cout<<"Enter Number"<<endl;
       cin>>number;

       ans=multi.number(number);

       cout<<"15th Multiple of"<<number<<" : "<<ans<<endl;
}
Output:

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Popular Posts

Labels

© Codepirate is powered by Blogger - Template designed by Stramaxon - Best SEO Template