Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

Write a program to check whether a

number is divisible by 7 or not. (Clue: see


below)
Write a program to check whether a
number is positive or negative. (Clue: see
below)

•A number is positive if it is greater than zero. We check this in the expression of if.

•If it is False, the number will either be zero or negative.


Write a program using switch statement that
accepts a number in the
range 1 to 12 and then displays the
corresponding month. (Clue: see below)
factorial of a number.
Perfect numbers
• A perfect number is a positive number that equals the sum of its
divisors, excluding itself.

You might also like