Skip to content

Commit d7f400a

Browse files
Update functions.md
1 parent 028adc0 commit d7f400a

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

assignments/functions.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,36 @@
1+
# Questions
12

3+
1. Define two methods to print the maximum and the minimum number respectively among three numbers entered by user.
4+
5+
2. Define a program to find out whether a given number is even or odd.
6+
7+
3. A person is elligible to vote if his/her age is greater than or equal to 18. Define a method to find out if he/she is elligible to vote.
8+
9+
4. Write a program to print the sum of two numbers entered by user by defining your own method.
10+
11+
5. Define a method that returns the product of two numbers entered by user.
12+
13+
6. Write a program to print the circumference and area of a circle of radius entered by user by defining your own method.
14+
15+
7. Define a method to find out if number is prime or not.
16+
17+
8. Write a program which will ask the user to enter his/her marks (out of 100). Define a method that will display grades according to the marks entered as below:
18+
Marks Grade
19+
91-100 AA
20+
81-90 AB
21+
71-80 BB
22+
61-70 BC
23+
51-60 CD
24+
41-50 DD
25+
<=40 Fail
26+
27+
9. Write a program to print the factorial of a number by defining a method named 'Factorial'.
28+
Factorial of any number n is represented by n! and is equal to 1*2*3*....*(n-1)*n. E.g.-
29+
4! = 1*2*3*4 = 24
30+
3! = 3*2*1 = 6
31+
2! = 2*1 = 2
32+
Also,
33+
1! = 1
34+
0! = 0
35+
36+
10. Write a function to find if a number if palindrome or not. Take number as parameter.

0 commit comments

Comments
 (0)