Nalp - Essay by Tarun99

TOP ESSAY WRITING SERVICES REVIEWS


Rank
Service
General
Prices

1
  • Since 2008
  • Free revisions
  • Money-back guaranty
  • Up to 5% for the first order. Up to 15% for the orders starting from 2nd

from $9.97/pp

visit site

2
  • Since 2009
  • Free title page, revisions
  • Discount policy
  • Satisfaction guarantee
  • More than 100 000 orders delivered

from $9.97/pp

visit site

3
  • Since 2010
  • PhD holding authors only
  • SMS notifications & VIP support
  • Discount policy

from $22/pp

visit site

4
  • Since 2010
  • 24/7 support team
  • More than 500 writers
  • Money-back guaranty
  • Up to 15% discounts

from $9.97/pp

visit site

 

My Account
Anti Essays

Welcome

Anti Essays offers essay examples to help students with their essay writing.

Sign Up

Nalp Essay

Open Document

Below is an essay on "Nalp" from Anti Essays, your source for research papers, essays, and term paper examples.

/* Write a Program to find the roots of an equation f(x)=0 using Bisection Method */
#include<stdio.h>
#include<conio.h>
#include<math.h>
void root(int n,float a,float b);
float f(float x);
void main()
{
int n;
float a,b;
clrscr();
printf("\n Enter the number of iterations:\n");
scanf("%d",&n);
printf("\n Enter the interval(a,b):");
scanf("%f %f",&a,&b);
root(n,a,b);
getch();
}
void root(int n,float a,float b)
{
int i;
float m;
for(i=1;i<n+1;i++)
{
m=(a+b)/2;
if(f(m)*f(a)<0)
b=m;
else
a=m;
}
printf("\n Roots is m=%f",a,b,m);
}
float f(float x)
{
float y=x*x*(x-5)*(x+1);
return(y);
}

OUTPUT
Enter the number of iterations: 3
Enter the interval (a, b): 0 1
Roots are m=0.875000



/* Write a Program to find the simple / multiple roots of f(x)=0 using Newton-Raphson method */

#include<stdio.h>
#include<conio.h>
#include<math.h>
float eps;
void iter(int n,float x);
float f(float x);
float df(float x);
void main()
{
int n;
float a;
clrscr();
printf("\n Enter number of iterations ");
scanf("%d",&n);
printf("\n ERROR TOLERANCE ");
scanf("%E",&eps);
printf("Enter the initial approximation ");
scanf("%f",&a);
iter(n,a);
getch();
}
void iter(int n,float x)
{
int i;
i=0;
for(i=1;i<=n;i++)
{
x=x-(f(x)/df(x));
if(fabs(f(x))<=eps)
break;
}
printf("\n Number of iteration=%d",i);
printf("\n the root is %f",x);
}
float f(float x)
{
return(x*exp(x)-2);
}
float df(float x)
{
return(exp(x)*(x+1));
}

OUTPUT
Enter the number of iterations: 5
ERROR TOLERANCE: 0.001
Enter the initial approximation:0 1
Number of iterations=6
The root is 0.853003

/* Write a Program to find the roots of system of non-linear algebraic equations using Newton’s method */

#include<stdio.h>
#include<conio.h>
#include<math.h>
float fun1(float,float);
float...

Show More


Related Essays

Citations

MLA Citation

"Nalp". Anti Essays. 23 Nov. 2017

<http://anties.wressy.com/free-essays/Nalp-117438.html>

APA Citation

Nalp. Anti Essays. Retrieved November 23, 2017, from the World Wide Web: http://anties.wressy.com/free-essays/Nalp-117438.html