Top 10 Programming Language to learn in 2023

Are you a programming enthusiast looking to stay ahead of the curve in 2023? With the ever-evolving tech landscape, keeping up with the Best Programming Language to learn can be a daunting task. Fear not, as we have compiled a list of the top 10 Programming Languages that you should consider learning in 2023. Python: This versatile language continues to dominate in 2023, with its ease of use, readability, and a vast library of modules. JavaScript: As web development grows increasingly popular, JavaScript remains a crucial player, with its ability to create dynamic and interactive web pages. Java: This language has stood the test of time and remains a popular choice for enterprise software development. C++: A staple in the gaming and systems development industries, C++ offers exceptional performance and memory management. Swift: Apple's preferred language for iOS app development, Swift continues to grow in popularity with its simplicity and reliability. R: As data science and machin...

C program to find the value using Newton Raphson | C Programming

C program to find the value using Newton Raphson

Before starting with the program let us learn something about Newton Raphson Method

Newton Raphson Method is open method and starts with one initial guess for finding real root of non-linear equations. In other Words, Newton Raphson method, also called the Newton’s method, is the fastest and simplest approach of all methods to find the real root of a nonlinear function. It is an open bracket approach, requiring only one initial guess. This method is quite often used to improve the results obtained from other iterative approaches




C program to find the value using Newton Raphson

#include<stdio.h>
#include <math.h>
#include<conio.h>
#define EST 0.05
#define F(x) 4*(x)*(x)*(x) - 2*(x) - 6
#define F1(x) 12*(x)*(x) - 2
int main()
{
int i = 1;
float xl;
double f1,fm,f0,error;
printf("\nEnter the value of x0: "); scanf("%f",&xl);
printf("\n__________________________________________________________________\n"); 
printf("\niteration\tx0\tf0\t f1\t fm\t error"); 
printf("\n___________________________________________________________________\n");
do
{
f0=F(xl); f1=F1(xl); fm=xl-(f0/f1);
error=(fabs((fm-xl)/fm));
printf("\n %d \t%.2lf\t %.2lf\t %.2lf\t %.4lf \t %.4lf", i,xl,f0,f1,fm,error);
if(error>EST)
{
 xl=fm; f0=F(xl); f1=F1(xl); fm=xl-(f0/f1);
error=(fabs((fm-xl)/fm));
i++;
printf("\n %d \t%.2lf\t %.2lf\t %.2lf\t %.4lf \t %.4lf", i,xl,f0,f1,fm,error); 
} 
else 
{ 
printf("\n__________________________________________________________\n"); 
printf("\n\nApp.root = %f",fm);
}
}while(error>EST);
return 0;
}


Comments

Popular posts from this blog

Array in C Programming | C Programming

C program to Find Cartesian Product of Two Sets | C programming

What is System? | SAD