Posted by MindBreaker at 3:48 AM
Read our previous post
Object:
Find the Remainder quotient between two number
Source Code:
#include <iostream>
using namespace std;
class
divide
{
public:
int *ans(int number1,int
number2)
{
int
remainder,qoutients,answer[2];
remainder=number1%number2;
qoutients=number1/number2;
answer[0]=remainder;
answer[1]=qoutients;
return
answer;
}
};
void
main()
{
divide div;
int
number1,number2, *ptr;
cout<<"Enter
numnber 1"<<endl;
cin>>number1;
cout<<"Enter
number 2"<<endl;
cin>>number2;
ptr=div.ans(number1,number2);
cout<<"
Remainder : "<<ptr[0]<<"
Qoutient : "<<ptr[1]<<endl;
}
Output
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.