#include<stdio.h>
#include<conio.h>
void main(){
int poly[100], m, r, i, q[100];
printf("\t\tSYNTHETIC DIVISION"); printf("\n Enter the highest degree of the equation (max 5): ");
for(i=0;i<=m;i++){
printf("\n Coefficient x[%d] = ", m
-i
); }
printf("\n Enter the value of constant in (x-r) : "); q[0] = poly[0];
for(i=1;i<=m;i++){
q[i] = (q[i-1]*r)+poly[i];
}
printf("\n Coefficients of quotient are: \n"); for(i=0;i<m;i++){
}
printf("\n Remainder is: %d", q
[m
]);
}
I2luY2x1ZGU8c3RkaW8uaD4KI2luY2x1ZGU8Y29uaW8uaD4KCnZvaWQgbWFpbigpewogICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgIGludCBwb2x5WzEwMF0sIG0sIHIsIGksIHFbMTAwXTsKICAgICAgICAgICAgICAgIHByaW50ZigiXHRcdFNZTlRIRVRJQyBESVZJU0lPTiIpOwogICAgICAgICAgICAgICAgcHJpbnRmKCJcbiBFbnRlciB0aGUgaGlnaGVzdCBkZWdyZWUgb2YgdGhlIGVxdWF0aW9uIChtYXggNSk6ICIpOwogICAgICAgICAgICAgICAgc2NhbmYoIiVkIiwmbSk7CgogICAgICAgICAgICAgICAgZm9yKGk9MDtpPD1tO2krKyl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJpbnRmKCJcbiBDb2VmZmljaWVudCB4WyVkXSA9ICIsIG0taSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NhbmYoIiVkIiwmcG9seVtpXSk7CiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgcHJpbnRmKCJcbiBFbnRlciB0aGUgdmFsdWUgb2YgY29uc3RhbnQgaW4gKHgtcikgOiAiKTsKICAgICAgICAgICAgICAgIHNjYW5mKCIlZCIsJnIpOwogICAgICAgICAgICAgICAgcVswXSA9IHBvbHlbMF07CiAgICAgICAgICAgICAgICBmb3IoaT0xO2k8PW07aSsrKXsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxW2ldID0gKHFbaS0xXSpyKStwb2x5W2ldOwogICAgICAgICAgICAgICAgfQoKICAgICAgICAgICAgICAgIHByaW50ZigiXG4gQ29lZmZpY2llbnRzIG9mIHF1b3RpZW50IGFyZTogXG4iKTsKICAgICAgICAgICAgICAgIGZvcihpPTA7aTxtO2krKyl7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJpbnRmKCJcdCVkIixxW2ldKTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgIHByaW50ZigiXG4gUmVtYWluZGVyIGlzOiAlZCIsIHFbbV0pOwpnZXRjaCgpOwoKfQ==