Code:
x=input('Enter first number:');
y=input('Enter second number:');
b=0;
c=0;
for i=1:x if(rem(x,i)==0) b=b+i; end
end
for i=1:y if(rem(y,i)==0) c=c+i; end
end
if((b/x)==(c/y)) disp('Yes, friendly pair');
else disp('No , not a friendly pair');
end
If you want to know more about friendly pair check this:
https://en.wikipedia.org/wiki/Friendl...
x=input('Enter first number:');
y=input('Enter second number:');
b=0;
c=0;
for i=1:x if(rem(x,i)==0) b=b+i; end
end
for i=1:y if(rem(y,i)==0) c=c+i; end
end
if((b/x)==(c/y)) disp('Yes, friendly pair');
else disp('No , not a friendly pair');
end
If you want to know more about friendly pair check this:
https://en.wikipedia.org/wiki/Friendl...
Friendly pair in MATLAB camera iphone 8 plus apk | |
1 Likes | 1 Dislikes |
16 views views | 1.03K followers |
Science & Technology | Upload TimePublished on 21 May 2019 |
Không có nhận xét nào:
Đăng nhận xét