Monday 24 August 2015

New Definition

Write a program to take 3 numbers a, r and n from user and print the arithmetic sequence like { a, ar, ar , ..., ar } sample input and output statements are given below .
Enter a: 5
Enter r: 2
Enter n: 4
Substituting value of 'a', 'r', and 'n' in the sequence {a, ar }
= {5, 5* , 5*2 , 5*2 , 5*2 }
= {5, 10, 20, 40, 80}

No comments:

Post a Comment