fork download
  1. #include<stdio.h>
  2. #include<conio.h>
  3. #include<math.h>
  4. int main()
  5. {
  6. int n,i,j;
  7. float a[10][10];
  8. float b[10],p,q,r;
  9. clrscr();
  10. printf("Enter the size of matrix");
  11. scanf("%d",&n);
  12. printf("Enter the elements");
  13. for(i=0;i<n;i++)
  14. {
  15. for(j=0;j<(n+1);j++)
  16. scanf("%f",&a[i][j]);
  17. }
  18. for(i=0,j=0;i<(n-1);i++,j++)
  19. {
  20. p=a[i][j];
  21. q=a[i+1][j];
  22. for(;i<n;i++)
  23. {
  24. for(;j<(n+1);j++)
  25. {
  26. a[i+1][j]=a[i+1][j]-((q/p)*a[i][j]);
  27. }
  28. }
  29. }
  30. for(i=n-1;i>=0;i--)
  31. {
  32. for(j=0;j<n-2;j++)
  33. {
  34. b[i]=a[i][j]*b[j];
  35. }
  36. b[i]=(a[n][n+1]-b[i])/a[n][n];
  37. printf("%f\n",b[i]);
  38. }
  39. getch();
  40. return 0;
  41. }
  42.  
  43.  
  44.  
  45.  
  46.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:2:18: error: conio.h: No such file or directory
cc1: warnings being treated as errors
prog.c: In function ‘main’:
prog.c:9: error: implicit declaration of function ‘clrscr’
prog.c:39: error: implicit declaration of function ‘getch’
prog.c:8: error: unused variable ‘r’
stdout
Standard output is empty