subject

4 Multiple Choice
You wrote a program to find the factorial of a number. In mathematics, the factorial operation is used for positive integers and zero.
What does the function return if the user enters a negative three?
def factorial number):
product = 1
while number > 0
product = product number
number = number - 1
return product
strNum = input("Enter a positive integer")
num = int(str Num)
print(factorial(num))
O-6
O-3
O There is no output due to a runtime error.
0 1
< PREVIOUS
NEXT >
SAVE
SUBMIT
© 2016 Glynlyon, Inc. All rights reserved.
V6.0 3-0038 20200504 mainline

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 17:00
Which of the following is not contained on the slide show toolbar? a. next button b. slide button c. close button d. pen tool
Answers: 1
question
Computers and Technology, 22.06.2019 23:30
Define a function printfeetinchshort, with int parameters numfeet and numinches, that prints using ' and " shorthand. ex: printfeetinchshort(5, 8) prints: 5' 8"
Answers: 1
question
Computers and Technology, 23.06.2019 00:40
Consider the following statements: struct nametype{string first; string last; }; struct coursetype{string name; int callnum; int credits; char grade; }; struct studenttype{nametype name; double gpa; coursetype course; }; studenttype student; studenttype classlist[100]; coursetype course; nametype name; mark the following statements as valid or invalid. if a statement is invalid, explain why.a.) student.course.callnum = "csc230"; b.) cin > > student.name; c.) classlist[0] = name; d.) classlist[1].gpa = 3.45; e.) name = classlist[15].name; f.) student.name = name; g.) cout < < classlist[10] < < endl; h.) for (int j = 0; j < 100; j++)classlist[j].name = name; i.) classlist.course.credits = 3; j.) course = studenttype.course;
Answers: 1
question
Computers and Technology, 23.06.2019 07:30
What is the penalty for violating section 1201 of title 17 chapter 21 of the us code
Answers: 1
You know the right answer?
4 Multiple Choice
You wrote a program to find the factorial of a number. In mathematics, the...
Questions
question
Mathematics, 14.04.2020 21:41
Questions on the website: 13722360