ramuremo Posted October 24, 2010 Report Posted October 24, 2010 Hi maa frnd Masters in biology chestunnadu vademo edo java course teesukunnadu so ee problem solve chesi help cheyyandi (naadi emo pharmacy program so naku no idea)1+1/2+1/3+1/4+----------------1/nwrite a program that compares the rsults of preceeding series computing from Left to Right and Right to Left with n=50000
krldr871 Posted October 24, 2010 Report Posted October 24, 2010 [quote author=ramuremo link=topic=112387.msg1195033#msg1195033 date=1287886140]Hi maa frnd Masters in biology chestunnadu vademo edo java course teesukunnadu so ee problem solve chesi help cheyyandi (naadi emo pharmacy program so naku no idea)1+1/2+1/3+1/4+----------------1/n[b]write a program that compares the rsults of preceeding series computing from Left to Right and Right to Left with n=50000[/b][/quote]idi koncham clear ga cheppu baa..naku ardham kaledu asalu problem statement..aa series result kanukkovaala..anthe naa..right to left and left to right enti..
ramuremo Posted October 24, 2010 Author Report Posted October 24, 2010 ok naku kuda sarigga teliyadu hope this helpsObtaining more accurate results: In computing the following series, you will obtain more results by computing from Right to Left rather than Left to Right. Idi question ki mundu ichindi bhaiyya hope this helps!!!!Thank you
TigerSatti Posted October 24, 2010 Report Posted October 24, 2010 Mavaa...Requiremnt konchem artham ayyetlu cheppu mavaa.... Tappakundaa try cheddam.atleast give an example... input and out put or this calculation has to be automated....like that.
krldr871 Posted October 24, 2010 Report Posted October 24, 2010 [quote author=ramuremo link=topic=112387.msg1195072#msg1195072 date=1287886737]ok naku kuda sarigga teliyadu hope this helpsObtaining more accurate results: In computing the following series, you will obtain more results by computing from Right to Left rather than Left to Right. Idi question ki mundu ichindi bhaiyya hope this helps!!!!Thank you[/quote]Idi edo experiment kosam kabatti extremely accurate undali..daaniki coding lo entha change untado telidu kani..double precision vaadite accuracy perugutundi..jus put a loop with initial value as 50000 and loop backwards performing the calculation..idi mari obvious..idi neeku telisi unte already nannu thittukoku F@!n F@!n
Thota Raamudu Posted October 24, 2010 Report Posted October 24, 2010 Idhi try cheyyi.import java.io.IOException;import java.util.Scanner;public class MySeriesCalculater { /** * @param args */ public static void main(String[] args) throws IOException { System.out.println("Enter N:"); Scanner ds = new Scanner(System.in); int n = ds.nextInt(); double result = 0; for(int i=1;i<=n;i++) { result+= (1.0)/i; } System.out.print("Result :"+result); }}
Thota Raamudu Posted October 24, 2010 Report Posted October 24, 2010 sorry maama requirement moththam choodaledhu ...kshaminchu...let me try again
Thota Raamudu Posted October 24, 2010 Report Posted October 24, 2010 idhi reverse calculation ... i mean from right to left. Here is the resultLeft to Right : 11.397003949278519Right to Left : 11.397003949278504I hope this helps .........import java.io.IOException;import java.util.Scanner;public class MySeriesCalculater { /** * @param args */ public static void main(String[] args) throws IOException { System.out.println("Enter N:"); Scanner ds = new Scanner(System.in); int n = ds.nextInt(); double result = 0; for(int i=n;i>0;i--) { result+= (1.0)/i; } System.out.print("Result :"+result); }}
Gunner Posted October 24, 2010 Report Posted October 24, 2010 [quote author=Thota Raamudu link=topic=112387.msg1195180#msg1195180 date=1287889403]idhi reverse calculation ... i mean from right to left. Here is the resultLeft to Right : 11.397003949278519Right to Left : 11.397003949278504I hope this helps .........import java.io.IOException;import java.util.Scanner;public class MySeriesCalculater { /** * @param args */ public static void main(String[] args) throws IOException { System.out.println("Enter N:"); Scanner ds = new Scanner(System.in); int n = ds.nextInt(); double result = 0; for(int i=n;i>0;i--) { result+= (1.0)/i; } System.out.print("Result :"+result); }}[/quote] Good job ! you rock you rock
ToughGuy Posted October 24, 2010 Report Posted October 24, 2010 [quote author=Thota Raamudu link=topic=112387.msg1195180#msg1195180 date=1287889403]idhi reverse calculation ... i mean from right to left. Here is the resultLeft to Right : 11.397003949278519Right to Left : 11.397003949278504I hope this helps .........import java.io.IOException;import java.util.Scanner;public class MySeriesCalculater { /** * @param args */ public static void main(String[] args) throws IOException { System.out.println("Enter N:"); Scanner ds = new Scanner(System.in); int n = ds.nextInt(); double result = 0; for(int i=n;i>0;i--) { result+= (1.0)/i; } System.out.print("Result :"+result); }}[/quote] ^^" ^^" you rock you rock
Recommended Posts