Saturday 14 November 2020

Write a program to input the value of x and n and print the sum of the series: x + x^2/2! - x^3/3! + x^4/4! + ............ x^n/n!

 PROGRAM:












INPUT & OUTPUT:



Write a program to input the value of x and n and print the sum of the series: x + x^2/2 - x^3/3 + x^4/4 + ........... x^n/n

 PROGRAM:











                

 INPUT & OUTPUT:





















Determine whether a number is a perfect number, an armstrong number or a palindrome


 Perfect number, a positive integer that is equal to the sum of its proper divisors. The smallest perfect number is 6, which is the sum of 1, 2, and 3. Other perfect numbers are 28, 496, and 8,128.


Armstrong number:  A number is called Armstrong number if it is equal to the sum of the cubes of its own digits.  For example: 153 is an Armstrong number since 153 = 1*1*1 + 5*5*5 + 3*3*3 and 371 is an Armstrong number since 371=3*3*3+7*7*7+1*1*1.


palindromic number (also known as a numeral palindrome or a numeric palindrome) is a number (such as 16461) that remains the same when its digits are reversed.

Write a program to input the value of x and n and print the sum of the series: 1-x+x^2-x^3+x^4 + ......... x^n

 PROGRAM:












INPUT & OUTPUT:



.Write a program to input the value of x and n and print the sum of the series: 1+x+x^2+x^3+x^4+ ............x^n

 PROGRAM:










INPUT & OUTPUT:



Given two integers x and n, compute x^n.

 PROGRAM:











INPUT & OUTPUT:





Tuesday 10 November 2020