Second Assignment

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

1)Write a program to find whether a given year is a leap year or not satisfying all the possible condition

for a leap year?

2) Write a program to Convert temperature entered in Fahrenheit to Celsius ?

Hint: The conversion formula is Celsius = (F-32) / 1.8

3) Write a program to calculate factorial of a number by accepting input from the user?

4)Write a program to calculate the sum and average of First n natural numbers by taking n as input from
the user?

5)Write a program which will find all such numbers which are divisible by 7 but are not a multiple of 5,

between 1 and 200 (both included).

The numbers obtained should be printed in a comma-separated sequence on a single line along with the
total number count.

6)Write a program to find the sum of squares of first 20 Odd numbers?

7)Write a program that accepts a sentence and calculate the number of letters and digits.

Suppose the following input is supplied to the program:

hello Codegnan! 243

Then, the output should be:

LETTERS 13

DIGITS 3

8)write a program to print the multiplication table of n,by taking n as input from user

9)Write a program to calculate the area of the triangle by accepting base and height as integer/float
input from the user?

10)Write a program to find the greatest number from three numbers by accepting three integer inputs
from the user?

You might also like