fork download
  1. #include<stdio.h>
  2. //#include<conio.h>
  3.  
  4. void main(){
  5.  
  6. int poly[100], m, r, i, q[100];
  7. printf("\t\tSYNTHETIC DIVISION");
  8. printf("\n Enter the highest degree of the equation (max 5): ");
  9. scanf("%d",&m);
  10.  
  11. for(i=0;i<=m;i++){
  12. printf("\n Coefficient x[%d] = ", m-i);
  13. scanf("%d",&poly[i]);
  14. }
  15.  
  16. printf("\n Enter the value of constant in (x-r) : ");
  17. scanf("%d",&r);
  18. q[0] = poly[0];
  19. for(i=1;i<=m;i++){
  20. q[i] = (q[i-1]*r)+poly[i];
  21. }
  22.  
  23. printf("\n Coefficients of quotient are: \n");
  24. for(i=0;i<m;i++){
  25. printf("\t%d",q[i]);
  26. }
  27. printf("\n Remainder is: %d", q[m]);
  28.  
  29. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:4:6: error: return type of ‘main’ is not ‘int’ [-Werror=main]
 void main(){
      ^
prog.c: In function ‘main’:
prog.c:28:1: error: implicit declaration of function ‘getch’ [-Werror=implicit-function-declaration]
 getch();
 ^
cc1: all warnings being treated as errors
stdout
Standard output is empty