List of if...else programming exercises
A.
1. Write a Java program to find maximum between two numbers
2. Write a Java program to find maximum between three numbers
3. Write a Java program to check whether a number is negative, positive or zero
4. Write a Java program to check whether a number is divisible by 5 and 11 or not
5. Write a Java program to check whether a number is even or odd
6. Write a Java program to check whether a year is leap year or not
7. Write a Java program to check whether a character is alphabet or not
8. Write a Java program to input any alphabet and check whether it is vowel or consonant
10. Write Java program to check whether a character is uppercase or lowercase alphabet
11. Write a Java program to input week number and print week day
12. Write a Java program to input month number and print number of days in that month
13. Write a Java program to count total number of notes in given amount
14. Write a Java program to input angles of a triangle and check whether triangle is valid or not
15. Write a Java program to input all sides of a triangle and check whether triangle is valid or not
16. Write a Java program to check whether the triangle is equilateral, isosceles or scalene triangle
17. Write a Java program to find all roots of a quadratic equation
Percentage >= 90% : Grade A
Percentage >= 80% : Grade B
Percentage >= 70% : Grade C
Percentage >= 60% : Grade D
Percentage >= 40% : Grade E
Percentage < 40% : Grade F
Basic Salary <= 10000 : HRA = 20%, DA = 80%
Basic Salary <= 20000 : HRA = 25%, DA = 90%
Basic Salary > 20000 : HRA = 30%, DA = 95%
For first 50 units Rs. 0.50/unit
For next 100 units Rs. 0.75/unit
For next 100 units Rs. 1.20/unit
For unit above 250 Rs. 1.50/unit
An additional surcharge of 20% is added to the bill
List of loop programming exercises
1. Write a Java program to print all natural numbers from 1 to n. - using while loop
2. Write a Java program to print all natural numbers in reverse (from n to 1). - Using while loop
3. Write a Java program to print all alphabets from a to z. - using while loop
4. Write a Java program to print all even numbers from 1 to 100. - Using while loop
5. Write a Java program to print all odd number from 1 to 100
6. Write a Java program to find sum of all natural numbers between 1 to n
7. Write a Java program to find sum of all even numbers between 1 to n
8. Write a Java program to find sum of all odd numbers between 1 to n
9. Write a Java program to print multiplication table of any number
10. Write a Java program to count number of digits in a number
11. Write a Java program to find first and last digit of a number
12. Write a Java program to find sum of first and last digit of a number
13. Write a Java program to swap first and last digits of a number
14. Write a Java program to calculate sum of digits of a number
15. Write a Java program to calculate product of digits of a number
16. Write a Java program to enter a number and print its reverse
17. Write a Java program to check whether a number is palindrome or not
18. Write a Java program to find frequency of each digit in a given integer
18. Write a Java program to find frequency of each digit in a given integer-2
19. Write a Java program to enter a number and print it in words
20. Write a Java program to print all ASCII character with their values
21. Write a Java program to find power of a number using for loop
22. Write a Java program to find all factors of a number
23. Write a Java program to calculate factorial of a number
24. Write a Java program to find HCF (GCD) of two numbers
25. Write a Java program to find LCM of two numbers
26. Write a Java program to check whether a number is Prime number or not
27. Write a Java program to print all Prime numbers between 1 to n
28. Write a Java program to find sum of all prime numbers between 1 to n
29. Write a Java program to find all prime factors of a number
30. Write a Java program to check whether a number is Armstrong number or not
31. Write a C program to print all Armstrong numbers between 1 to n
32. Write a Java program to check whether a number is Perfect number or not
33. Write a Java program to print all Perfect numbers between 1 to n
34. Write a C program to check whether a number is Strong number or not.
Write a C program to print Fibonacci series up to n terms.
Write a C program to find one's complement of a binary number.
Write a C program to find two's complement of a binary number.
Write a C program to convert Binary to Octal number system.
Write a C program to convert Binary to Decimal number system.
Write a C program to convert Binary to Hexadecimal number system.
Write a C program to convert Octal to Binary number system.
Write a C program to convert Octal to Decimal number system.
Write a C program to convert Octal to Hexadecimal number system.
Write a C program to convert Decimal to Binary number system.
Write a C program to convert Decimal to Octal number system.
Write a C program to convert Decimal to Hexadecimal number system.
Write a C program to convert Hexadecimal to Binary number system.
Write a C program to convert Hexadecimal to Octal number system.
Write a C program to convert Hexadecimal to Decimal number system.
Write a C program to print Pascal triangle up to n rows.
Star pattern programs - Write a C program to print the given star patterns.
Number pattern programs - Write a C program to print the given number patterns.
Pattern Problem (Nested Loop)
List of array programming exercises
- Write a C program to read and print elements of array.
- Write a C program to print all negative elements in an array.
- Write a C program to find sum of all array elements.
- Write a C program to find maximum and minimum element in an array.
- Write a C program to find second largest element in an array.
- Write a C program to count total number of even and odd elements in an array.
- Write a C program to count total number of negative elements in an array.
- Write a C program to copy all elements from an array to another array.
- Write a C program to insert an element in an array.
- Write a C program to delete an element from an array at specified position.
- Write a C program to count frequency of each element in an array.
- Write a C program to print all unique elements in the array.
- Write a C program to count total number of duplicate elements in an array.
- Write a C program to delete all duplicate elements from an array.
- Write a C program to merge two array to third array.
- Write a C program to find reverse of an array.
- Write a C program to put even and odd elements of array in two separate array.
- Write a C program to search an element in an array.
- Write a C program to sort array elements in ascending or descending order.
- Write a C program to sort even and odd elements of array separately.
- Write a C program to left rotate an array.
- Write a C program to right rotate an array.
Two Dimensional Array Practice problems
List of string programming exercises
- Write a C program to find length of a string.
- Write a C program to copy one string to another string.
- Write a C program to concatenate two strings.
- Write a C program to compare two strings.
- Write a C program to convert lowercase string to uppercase.
- Write a C program to convert uppercase string to lowercase.
- Write a C program to toggle case of each character of a string.
- Write a C program to find total number of alphabets, digits or special character in a string.
- Write a C program to count total number of vowels and consonants in a string.
- Write a C program to count total number of words in a string.
- Write a C program to find reverse of a string.
- Write a C program to check whether a string is palindrome or not.
- Write a C program to reverse order of words in a given string.
- Write a C program to find first occurrence of a character in a given string.
- Write a C program to find last occurrence of a character in a given string.
- Write a C program to search all occurrences of a character in given string.
- Write a C program to count occurrences of a character in given string.
- Write a C program to find highest frequency character in a string.
- Write a C program to find lowest frequency character in a string.
- Write a C program to count frequency of each character in a string.
- Write a C program to remove first occurrence of a character from string.
- Write a C program to remove last occurrence of a character from string.
- Write a C program to remove all occurrences of a character from string.
- Write a C program to remove all repeated characters from a given string.
- Write a C program to replace first occurrence of a character with another in a string.
- Write a C program to replace last occurrence of a character with another in a string.
- Write a C program to replace all occurrences of a character with another in a string.
- Write a C program to find first occurrence of a word in a given string.
- Write a C program to find last occurrence of a word in a given string.
- Write a C program to search all occurrences of a word in given string.
- Write a C program to count occurrences of a word in a given string.
- Write a C program to remove first occurrence of a word from string.
- Write a C program to remove last occurrence of a word in given string.
- Write a C program to remove all occurrence of a word in given string.
- Write a C program to trim leading white space characters from given string.
- Write a C program to trim trailing white space characters from given string.
- Write a C program to trim both leading and trailing white space characters from given string.
- Write a C program to remove all extra blank spaces from given string.
List of function and recursion programming exercises
- Write a C program to find cube of any number using function.
- Write a C program to find diameter, circumference and area of circle using functions.
- Write a C program to find maximum and minimum between two numbers using functions.
- Write a C program to check whether a number is even or odd using functions.
- Write a C program to check whether a number is prime, Armstrong or perfect number using functions.
- Write a C program to find all prime numbers between given interval using functions.
- Write a C program to print all strong numbers between given interval using functions.
- Write a C program to print all Armstrong numbers between given interval using functions.
- Write a C program to print all perfect numbers between given interval using functions.
- Write a C program to find power of any number using recursion.
- Write a C program to print all natural numbers between 1 to n using recursion.
- Write a C program to print all even or odd numbers in given range using recursion.
- Write a C program to find sum of all natural numbers between 1 to n using recursion.
- Write a C program to find sum of all even or odd numbers in given range using recursion.
- Write a C program to find reverse of any number using recursion.
- Write a C program to check whether a number is palindrome or not using recursion.
- Write a C program to find sum of digits of a given number using recursion.
- Write a C program to find factorial of any number using recursion.
- Write a C program to generate nth Fibonacci term using recursion.
- Write a C program to find GCD (HCF) of two numbers using recursion.
- Write a C program to find LCM of two numbers using recursion.
- Write a C program to display all array elements using recursion.
- Write a C program to find sum of elements of array using recursion.
- Write a C program to find maximum and minimum elements in array using recursion.