## Programming Assignments

**BASIC**

**1. Area of circle 2*Pi*r**

2. Fahrenheit to Celsius

3. simple Interest

4. Compound Interest

5. Currency Converter dollar to rupee

**If-Else**

0. Find the given number is even or odd.

**If-else-if**

1. Write a program to calculate gross salary.

DA=90% and HRA=10% if basic salary<15000.

DA=98% and HRA=500 if basic salary>=15000.

NO DA HRA if salary <10000

2. Write a program that inputs a pair of number num1 and num2 and divide the larger of the two by smaller. Note it will first be necessary to test for a zero value, since divide by zero will cause program to halt immediately.

3. The marks obtained by student in five different subjects are input through the keyboard.the student get division or grade as per the following rule:

-60% or above ---- first class

-50% to 59% ------ second class

-40% to 49% ------ third class

-Less than 40% ------ Fail

Write a program to calculate the grades obtained by the student.

4. Solve above problem using Logical operator

**SWITCH**

5. Write a program to find all the types of roots of a given quadratic equation.

6. A bank offers 14%,15% and 16% interest on 1 year , 2year and 3 year deposit. Write a programme to rate deposit amount and compute and print maturity amount.

**WHILE**

7.Write a menu driven program to read integer no. and find their sum difference and product.

8.Write a program to convert decimal to binary.

9. Write a program to find the area of circle

10.write a program to count the number of occurrence of digit in a number.

11. write a program to find the sum of digit of a given number.

12. write a program to reverse a given number.

13. menu driven program

1.reverse number.

2.sum of all digit.

3.number of digit.

4.product of all digit.

5.big digit.

6.smallest digit.

14 check the number is palindrome or not.

15. write a program using while loop to calculate and print the first ‘N’ Ex=10 Fibonacci number starts with (1,1),2, 3,5,8,13,21,34,55

16. write a Program to calculate factorial of a given number.

17.find the sum of cosine series up to given accuracy.

18.write a program to generate all 3 digit Armstrong numbers.

19. write a program to sum the series

1!+2!+3!+---------+N!.

20. write a program to find the sum of N numbers.

21.generate a fibonnaci series upto N and count the numbers.

22.write a program to generate fibonncci series upto given limit and count the number of prime number in the series and find the sum of prime number in the series.

**For loop**

23. Wrie a program which accept a number ‘N’ and then find the sum of the integer from 1 to 2, then 1 to 3 then 1 to 4 and so forth until it display the sum of integers from 1 to N.

24. write a program to print a factorial table using for loop

For ex 1! 1

2! 2

3! 6

25. write a program to test whether a given number is prime or not.?(Use GOTO statement).

26.Above program without goto statement.

27.print all the prime numbers between two given numbers.

28. Write a program to compute the sum of first ‘N’ terms (n>=1) of the series

1-3+5-7+9……………………

k=-1

pow(k,i+1)

**For loop Nesting**

29.write a program to print the multiplication table

1 2 3 4 5 6 7 8 9 10

2 4 6 8 10 12 14 16 18 20

.

.

N

**String Handling**

1. Write a program to read a character from the keyboard and test whether it is an alphabet or digit or not alphanumeric?

2. Write a program to read an alphabet and test whether it is lower case or upper case.

3. Write a program to read a character and change it’s case.