#include<stdio.h>
//#include<conio.h>
void main( ) {
int poly[ 100 ] , m, r, i, q[ 100 ] ;
printf ( "\t \t SYNTHETIC 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
] ) ;
}
I2luY2x1ZGU8c3RkaW8uaD4KLy8jaW5jbHVkZTxjb25pby5oPgoKdm9pZCBtYWluKCl7CiAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgaW50IHBvbHlbMTAwXSwgbSwgciwgaSwgcVsxMDBdOwogICAgICAgICAgICAgICAgcHJpbnRmKCJcdFx0U1lOVEhFVElDIERJVklTSU9OIik7CiAgICAgICAgICAgICAgICBwcmludGYoIlxuIEVudGVyIHRoZSBoaWdoZXN0IGRlZ3JlZSBvZiB0aGUgZXF1YXRpb24gKG1heCA1KTogIik7CiAgICAgICAgICAgICAgICBzY2FuZigiJWQiLCZtKTsKCiAgICAgICAgICAgICAgICBmb3IoaT0wO2k8PW07aSsrKXsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmludGYoIlxuIENvZWZmaWNpZW50IHhbJWRdID0gIiwgbS1pKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY2FuZigiJWQiLCZwb2x5W2ldKTsKICAgICAgICAgICAgICAgIH0KCiAgICAgICAgICAgICAgICBwcmludGYoIlxuIEVudGVyIHRoZSB2YWx1ZSBvZiBjb25zdGFudCBpbiAoeC1yKSA6ICIpOwogICAgICAgICAgICAgICAgc2NhbmYoIiVkIiwmcik7CiAgICAgICAgICAgICAgICBxWzBdID0gcG9seVswXTsKICAgICAgICAgICAgICAgIGZvcihpPTE7aTw9bTtpKyspewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHFbaV0gPSAocVtpLTFdKnIpK3BvbHlbaV07CiAgICAgICAgICAgICAgICB9CgogICAgICAgICAgICAgICAgcHJpbnRmKCJcbiBDb2VmZmljaWVudHMgb2YgcXVvdGllbnQgYXJlOiBcbiIpOwogICAgICAgICAgICAgICAgZm9yKGk9MDtpPG07aSsrKXsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmludGYoIlx0JWQiLHFbaV0pOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgcHJpbnRmKCJcbiBSZW1haW5kZXIgaXM6ICVkIiwgcVttXSk7CmdldGNoKCk7Cgp9