Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5
1.
Write a program to calculate gross salary of an
employee using the following formula.. Gross salary = basic + HRA + DA where HRA = 12% of basic DA = 10% of basic basic is input through keyboard.. 2. Write a program to interchange the values of two variables. 3. Write a program to convert given number of days into months and days. 4. Write a program to find the largest of three numbers. 5. While purchasing certain items, a discount of 10% is offered if the quantity purchased is more than 1000. If quantity and price per item are input through the keyboard, write a program to calculate the total expenses. 6. Write a program to check whether a year is leap year or not. (year % 400 ==0) || (year % 4 ==0 && year%100 !=0)
7. Write a program to check whether the entered
character is vowel or not. 8. Write a program to display weekday according to given weekday number. 9. Write a program to design calculator with basic operations using switch. 10. Write a program to calculate factorial of a number. 11. Write a program to display Fibonacci series upto a range. 12. Write a program to calculate sum of digits of a given number. 13. Write a program to check whether a number is an armstrong number or not. (A number that is equal to the sum of cubes of its digits is known as an Armstrong number . e.g. 153 , 370,371,407 etc.) 14. Write a program to check whether a number is perfect or not. (A positive number which is equal to the sum of its divisors is called as a perfect number. E.g. 6 , 28 etc.) 15. Write a program to check whether a number is prime or not. 16. Write a program to check whether a number is palindrome or not. (A number is said to be palindrome if it is equal to its reverse number. E.g.151) 17. Write a program to evaluate 1-2+3-4+5-6.. 18. Write a program to evaluate 1 +1/2+1/3+1/4..... 19. Write a program to display a star pattern as follows. * * * * * * 20. Write a program to display a pattern as follows. A A B A B C A B C D
21. Write a program to display maximum element
of an array. 22. Write a program to find an element in an array. (linear search) 23. Write a program to arrange the elements of the array in ascending order. 24. Write a program to find the transpose of a matrix. 25. Write a program to add two matrices. 26. Write a program to find the reverse of a number using function. 27. Write a program to calculate factorial of a number using recursion. 28. Write a program to read the details of employees like employee name , age and salary and display it on monitor.(Use structure) 29. A file named DATA contains a series of integer numbers. Write a program to read these numbers and then write all ‘odd’ numbers to a file called ODD and all ‘even’ numbers to a file called ‘EVEN’. 30. Write a program that will receive a file name and a line of text as command line arguments and write the text to the file.