Posted by MindBreaker 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.