Ask a New Question

Question

write a program thatprint on secreen the reselt of the following series:
d=1+2/x^2+3/x^3+.....r/x^r .
thanks
11 years ago

Answers

Steve
in perl,

$sum = 1;
$sum += $n/$x**$n foreach $n (2..$r);
print $sum;

I leave it to you to provide values for x and r.
11 years ago

Related Questions

Write the program that will calculate and display the career statistics for a hockey player. The pro... how do you write a program for an accountant using java to calculate income tax? I am trying to write a program to generate a diamond shape each line has odd number of circles. have... write a program C++ program and Use a recursive function that finds the n-th term using the followin... Write a program which allows user to enter 10 student names and scores for Java programming 1 and Ja... write program for 1,2,4,7,11,16.....n times 4.Write a program that will predict the size of a population of organisms. The program should ask fo... Write a C++ program that will accept the marks in a test for a group of 5 students . Write a program that allows a small business owner to input, in parallel arrays, the type of item,... Write a C program that allow the user to enter sales from 10 sales reps
Ask a New Question
Archives Contact Us Privacy Policy Terms of Use