0% found this document useful (0 votes)
5 views

Include

The document contains three C programs that perform calculations involving series and error estimation. The first program computes an approximation of a value using a loop until a specified error threshold is met. The second and third programs calculate the sum of a series and the percentage error compared to a predefined constant, with the third program also calculating the series in reverse order.

Uploaded by

qaisalam4621
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Include

The document contains three C programs that perform calculations involving series and error estimation. The first program computes an approximation of a value using a loop until a specified error threshold is met. The second and third programs calculate the sum of a series and the percentage error compared to a predefined constant, with the third program also calculating the series in reverse order.

Uploaded by

qaisalam4621
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

#include<stdio.

h>

#include<math.h>

int main() {

float a,e_t= pow(10,-6), m,e_s;

scanf("%f",&a);

float x=(0.001*(a));

do{

m=x;

x=(x*(a/x))/2;

e_s=(x-m)/x;

}while(e_s<=e_t);

printf("%f", e_s);

return 0;

#include <stdio.h>

int main() {

float i=1.0,a=0,b=1.082323,c, e;

while(i<=10000){

c=c+1/(i*i*i*i);

i++;

printf("%f\n",c);

e=((b-c)/b)*100;

printf("%f",e);

return 0;

}
#include <stdio.h>

int main() {

float i=1.0,a=1.082323,b, e;

while(i<=10000){

b=b+1/(i*i*i*i);

i++;

printf("%f\n",b);

e=((a-b)/a)*100;

printf("%f\n",e);

float c,d;

while(i>=1){

d=d+1/(i*i*i*i);

i--;

printf("%f\n",d);

c=(a-d)/a;

printf("%f",c);

return 0;

You might also like