Posts

newton raphson method explanation

newton raphson method is used for finding the root of nonlinear equations.  for example, if you want to find the root of equation x*x-9=0  we now we will get x value 2. but let's calculate with the newton raphson method.  formula: X=Xo-f(x)/ f'(x)  x0=intial value  f(x)=equation  f'(x)= differentiation of equation  you have to guess the initial value. if your initial value is closer to the root newton's raphson method will find the root faster.  let you have taken initial value 1 put 1 in equation f(x)=-8 and f'(x)=2  put above value in formula.  x=1+8/2, x=5  now again find f(x) and f'(x) will repeat the above step until you get the root you can find  newton raphson method in c

Hello World program hackerrank solution

                          Task This challenge requires you to print on a single line, and then print the already provided input string to  stdout . If you are not familiar with C, you may want to read about the printf() command. Example The required output is: Hello, World! Life is beautiful Function Descriptio Complete the main() function below. The main() function has the following input: string s:  a string Prints *two strings: * "Hello, World!" on one line and the input string on the next line. Input Format There is one line of text,  . Sample Input 0 Welcome to C programming. Sample Output 0 Hello, World! Welcome to C programming Solution: #include   < stdio.h > #include   < string.h > int  main()  {           char  s[ 100 ];     scanf( "%[^\n]%*c" , &s);    ...