Skip to content

Commit e32305e

Browse files
Merge pull request kunal-kushwaha#68 from Manish-kasera/manish
Assignment for Function module
2 parents e14950b + d30f840 commit e32305e

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

assignments/function.txt

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
1.Define two methods to print the maximum and the minimum number respectively among three numbers entered by user.
2+
3+
2.Define a program to find out whether a given number is even or odd.
4+
5+
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.
6+
7+
4.Write a program to print the sum of two numbers entered by user by defining your own method.
8+
9+
5.Define a method that returns the product of two numbers entered by user.
10+
11+
6.Write a program to print the circumference and area of a circle of radius entered by user by defining your own method.
12+
13+
7.Define a method to find out if number is prime or not.
14+
15+
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:
16+
Marks Grade
17+
91-100 AA
18+
81-90 AB
19+
71-80 BB
20+
61-70 BC
21+
51-60 CD
22+
41-50 DD
23+
<=40 Fail
24+
25+
9.Write a program to print the factorial of a number by defining a method named 'Factorial'.
26+
Factorial of any number n is represented by n! and is equal to 1*2*3*....*(n-1)*n. E.g.-
27+
4! = 1*2*3*4 = 24
28+
3! = 3*2*1 = 6
29+
2! = 2*1 = 2
30+
Also,
31+
1! = 1
32+
0! = 0

0 commit comments

Comments
 (0)