Home
Q&A
Education
Technology
Credit
General
Health
Insurance
Questions
Ask a Question
write a program in Python to print the sum of the following series: s=1+x+x^2+x^3+…..+x^n
Home
Education
write a program in Python to print the sum of the...
asked
Dec 9, 2021
in
Education
by
JackTerrance
write a program in Python to print the sum of the following series: s=1+x+x^2+x^3+…..+x^n Select the correct answer from above options
computer-science-interview-questions
computer-science-questions
1
Answer
0
votes
answered
Dec 9, 2021
by
JackTerrance
Answer: n=int(input(‘write no. of terms ‘)) x=int(input(‘write value of x ‘)) sum=1 while n>0: sum=sum+x(star)(star)n n=n-1 print(sum) explanation: star = asterisk
Related questions
0
votes
Q: write a program in python to obtain 3 numbers and print their sum.
write a program in python to obtain 3 numbers and print their sum. Select the correct answer from above options...
asked
Nov 29, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: Write statements in QBASIC for each of the situations described below.(ii) Assign the value represented by variable N to the variable N1.(1) Assign a value 2 to the variable A.(iii) Assign “INDIA” to a variable A$.(iv) Assign the sum of the two variables X and Y to the variable z
Write statements in QBASIC for each of the situations described below. (ii) Assign the value represented by variable ... the variable A Select the correct answer from above options...
asked
Nov 29, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: Write a menu-driven program to print the following patterns, where number of rowsfor the pattern should be the user input:a. Press 1 to print the following pattern:55 85 8 135 8 13 205 8 13 20 29b. Press 2 to print the following pattern:22 92 9 282 9 28 652 9 28 65 126c. Print the following series:
Write a menu-driven program to print the following patterns, where number of rows for the pattern should be the user ... 2 4 8 32 Select the correct answer from above options...
asked
Nov 29, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: Write a python program to print first n(entered by user) even natural numbers.
Write a python program to print first n(entered by user) even natural numbers. Select the correct answer from above options...
asked
Dec 25, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: Develop a java program that will print the series (16*1)+(14*2)…(4*7)..Only ANEEK MITRA WILL ANSWER!
Develop a java program that will print the series (16*1)+(14*2)…(4*7)..Only ANEEK MITRA WILL ANSWER! Select the correct answer from above options...
asked
Nov 26, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: What would be the output of the following program segments? Give reasons to justify your answer.i) System.out.print(“Sum =”+6 + 2);ii) System.out.print(“Sum = ”+ ‘B’+ ‘2’);iii) System.out.print(“Sum = ”+ 6 + ‘B’);iv) System.out.print(“Sum = ”+ (‘B’ + ‘a’));
What would be the output of the following program segments? Give reasons to justify your answer. i) System.out.print( Sum ... + a ); Select the correct answer from above options...
asked
Nov 27, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: How to write a program in JAVA to print the sum of ASCII values of a particular word input ?
How to write a program in JAVA to print the sum of ASCII values of a particular word input ? Select the correct answer from above options...
asked
Dec 28, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: write a program to print fibonacci series . write a program to search an element within the array using binary search
write a program to print fibonacci series . write a program to search an element within the array using binary search Select the correct answer from above options...
asked
Dec 29, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: Write instruction in interactive mode for the following:(i) to display sum of 8,9.0,2*3
Write instruction in interactive mode for the following: (i) to display sum of 8,9.0,2*3 (ii) to print sum of 8,9.0,2*3 Select the correct answer from above options...
asked
Dec 2, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: Question No.1: What do you understand about container tag and empty tag, give example?Question No.2: What do you understand about attributes of tag, give example?Question No.3: What do you mean about face attribute of font tag?Question No.4: Write syntax of Body tag along with all the attributes?Question No.5: What do you understand about a list in HTML?Question No.6: How many type of lists can be created in HTML? Explain them.Question No.7: Write small program in HTML to generate two different types of list.
Question No.1: What do you understand about container tag and empty tag, give example? Question No.2: What do ... all the attributes? Select the correct answer from above options...
asked
Nov 29, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: Write a program in python to insert ten friends name in a list, then print 3rd, 5th and 9th value from the list (using data structure)
Write a program in python to insert ten friends name in a list, then print 3rd, 5th and 9th value from the list (using data structure) Select the correct answer from above options...
asked
Dec 14, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: Write a C program to print the following pattern:10 11 0 10 1 0 1
Write a C program to print the following pattern: 1 0 1 1 0 1 0 1 0 1 1 0 1 0 1 Select the correct answer from above options...
asked
Dec 7, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: Write a C program to print the following pattern:10 11 0 10 1 0 1
Write a C program to print the following pattern: 1 0 1 1 0 1 0 1 0 1 1 0 1 0 1 Select the correct answer from above options...
asked
Dec 5, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: Write a C program to print the following pattern:10 11 0 10 1 0 1
Write a C program to print the following pattern: 1 0 1 1 0 1 0 1 0 1 1 0 1 0 1 Select the correct answer from above options...
asked
Nov 26, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: (ii) Assign the value represented by variable N to the variable N1.(iv) Assign the sum of the two variables X and Y to the variable Z.(V) Divide a number 33 with 7 and store its remainder into the variable(0) AssignWrite1.&(iii) Assign “INDIA” to a variable A$.
(ii) Assign the value represented by variable N to the variable N1. (iv) Assign the sum of the two variables ... . What is nrogramming? Select the correct answer from above options...
asked
Dec 1, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
...