3/20/2020 C23 Programming Examples With Output Pdf
Java programs are frequently asked in the interview. These programs can be asked from control statements, array, string, oops etc. Java basic programs like fibonacci series, prime numbers, factorial numbers and palindrome numbers are frequently asked in the interviews and exams. Let's see the list of Java programs.
![]() Java Basic Programs1) Fibonacci series
Write a java program to print fibonacci series without using recursion and using recursion.
Input: 10
Covers basic C# programming and various advanced concepts related to C#. This tutorial has been prepared for the beginners to help them understand basics of c#. You can see the output Hello World printed on the screen. CISC 3120 C23: User Agent & Web Server Communication Hui Chen Department of Computer & Information Science CUNY Brooklyn College 5/2/2018 CUNY Brooklyn College 1.
Output: 0 1 1 2 3 5 8 13 21 34
2) Prime number
Write a java program to check prime number.
![]()
Input: 44
Output: not prime number
Input: 7
Output: prime number
3) Palindrome number
Write a java program to check palindrome number.
Input: 329
Output: not palindrome number
Input: 12321
Output: palindrome number
4) Factorial number
Write a java program to print factorial of a number.
Input: 5
Output: 120
Input: 6
Output: 720
5) Armstrong number
Write a java program to check Armstrong number.
Input: 153
Output: Armstrong number
Input: 22
Output: not Armstrong number
Java Sorting Programs1) Bubble Sort
Write a java program to sort an array elements using bubble sort algorithm.
Input: 18 9 33 4 84 32
Output: 4 9 18 32 33 84
2) Selection Sort
Write a java program to sort an array elements using selection sort algorithm.
Input: 18 9 33 4 84 32
Output: 4 9 18 32 33 84
3) Insertion Sort
Write a java program to sort an array elements using insertion sort algorithm.
Input: 18 9 33 4 84 32
Output: 4 9 18 32 33 84
Java Searching Programs1) Linear Search
Write a java program to perform linear search in java.
2) Binary Search
Write a java program to perform binary search in java.
Java Array Programs1) Java Program to copy all elements of one array into another array2) Java Program to find the frequency of each element in the array3) Java Program to left rotate the elements of an array4) Java Program to print the duplicate elements of an array5) Java Program to print the elements of an array6) Java Program to print the elements of an array in reverse order7) Java Program to print the elements of an array present on even position8) Java Program to print the elements of an array present on odd position9) Java Program to print the largest element in an array10) Java Program to print the smallest element in an array11) Java Program to print the number of elements present in an array12) Java Program to print the sum of all the items of the array13) Java Program to right rotate the elements of an array14) Java Program to sort the elements of an array in ascending order15) Java Program to sort the elements of an array in descending order16) Find 3rd Largest Number in an Array
Write a java program to find 3rd largest number in an array.
Input: 1,2,5,6,3,2
Output: 3
17) Find 2nd Largest Number in an Array
Write a java program to find 2nd largest number in an array.
Input: 1,2,5,6,3,2
Output: 5
18) Find Largest Number in an Array
Write a java program to find largest number in an array.
Input: 1,2,5,6,3,2
Output: 6
19) Find 2nd Smallest Number in an Array
Write a java program to find 2nd smallest number in an array.
Input: 1,2,5,6,3,2
Output: 2
20) Find Smallest Number in an Array
Write a java program to find smallest number in an array.
Input: 1,2,5,6,3,2
Output: 1
21) Remove Duplicate Element in an Array
Write a java program to remove duplicate element in an array.
Input: 10,20,20,30,30,40,50,50
Output: 10 20 30 40 50
22) Add Two Matrices
Write a java program to add two matrices.
Input:
Output:
23) Multiply Two Matrices
Write a java program to multiply two matrices.
Input:
Output:
24) Print Odd and Even Number from an Array
Write a java program to print odd and even number from an array.
Input: 1,2,5,6,3,2
Output:
25) Transpose matrix
Write a java program to transpose a matrix.
Output:
Java Matrix ProgramsJava Matrix Programs2) Java Program to subtract the two matrices3) Java Program to determine whether a given matrix is an identity matrix4) Java Program to determine whether a given matrix is a sparse matrix5) Java Program to determine whether two matrices are equal6) Java Program to display the lower triangular matrix7) Java Program to display the upper triangular matrix8) Java Program to find the frequency of odd & even numbers in the given matrix9) Java Program to find the product of two matrices10) Java Program to find the sum of each row and each column of a matrix11) Java Program to find the transpose of a given matrixJava String programs1) Java Program to count the total number of characters in a string2) Java Program to count the total number of characters in a string 23) Java Program to count the total number of punctuation characters exists in a String4) Java Program to count the total number of vowels and consonants in a string5) Java Program to determine whether two strings are the anagram6) Java Program to divide a string in 'N' equal parts.7) Java Program to find all subsets of a string8) Java Program to find the longest repeating sequence in a string9) Java Program to find all the permutations of a string10) Java Program to remove all the white spaces from a string11) Java Program to replace lower-case characters with upper-case and vice-versa12) Java Program to replace the spaces of a string with a specific character13) Java Program to determine whether a given string is palindrome14) Java Program to determine whether one string is a rotation of another15) Java Program to find maximum and minimum occurring character in a string16) Java Program to find Reverse of the string17) Java program to find the duplicate characters in a string18) Java program to find the duplicate words in a string19) Java Program to find the frequency of characters20) Java Program to find the largest and smallest word in a string21) Java Program to find the most repeated word in a text file22) Java Program to find the number of the words in the given text file23) Java Program to separate the Individual Characters from a String24) Java Program to swap two string variables without using third or temp variable.25) Java Program to print smallest and biggest possible palindrome word in a given stringJava Pattern programs1) Java Program to count the total number of punctuation characters exists in a String2) Java program to print the following pattern3) Java program to print the following pattern 24) Java program to print the following pattern 35) Java program to print the following pattern 46) Java program to print the following pattern 57) Java program to print the following pattern on the console8) Java program to print the following pattern on the console 29) Java program to print the following pattern on the console 310) Java program to print the following pattern on the console 411) Java program to print the following pattern on the console 512) Java program to print the following pattern on the console 613) Java program to print the following pattern on the console 714) Java program to print the following pattern on the console 815) Java program to print the following pattern on the console 916) Java program to print the following pattern on the console 1017) Java program to print the following pattern on the console 1118) Java program to print the following pattern on the console 1219) Java program to print the following spiral pattern on the consoleJava Singly Linked List Programs1) Singly linked list Examples in Java2) Java Program to create and display a singly linked list3) Java program to create a singly linked list of n nodes and count the number of nodes4) Java program to create a singly linked list of n nodes and display it in reverse order5) Java program to delete a node from the beginning of the singly linked list6) Java program to delete a node from the middle of the singly linked list7) Java program to delete a node from the end of the singly linked list8) Java program to determine whether a singly linked list is the palindrome9) Java program to find the maximum and minimum value node from a linked list10) Java Program to insert a new node at the middle of the singly linked list11) Java program to insert a new node at the beginning of the singly linked list12) Java program to insert a new node at the end of the singly linked list13) Java program to remove duplicate elements from a singly linked list14) Java Program to search an element in a singly linked listJava Circular Linked List Programs1) Java program to create and display a Circular Linked List2) Java program to create a Circular Linked List of N nodes and count the number of nodes3) Java program to create a Circular Linked List of n nodes and display it in reverse order4) Java program to delete a node from the beginning of the Circular Linked List5) Java program to delete a node from the end of the Circular Linked List6) Java program to delete a node from the middle of the Circular Linked List7) Java program to find the maximum and minimum value node from a circular linked list8) Java program to insert a new node at the beginning of the Circular Linked List9) Java program to insert a new node at the end of the Circular Linked List10) Java program to insert a new node at the middle of the Circular Linked List11) Java program to remove duplicate elements from a Circular Linked List12) Java program to search an element in a Circular Linked List13) Java program to sort the elements of the Circular Linked ListJava Doubly Linked List Programs1) Java program to convert a given binary tree to doubly linked list2) Java program to create a doubly linked list from a ternary tree3) Java program to create a doubly linked list of n nodes and count the number of nodes4) Java program to create a doubly linked list of n nodes and display it in reverse order5) Java program to create and display a doubly linked list6) Java program to delete a new node from the beginning of the doubly linked list7) Java program to delete a new node from the end of the doubly linked list8) Java program to delete a new node from the middle of the doubly linked list9) Java program to find the maximum and minimum value node from a doubly linked list10) Java program to insert a new node at the beginning of the Doubly Linked list10) Java program to insert a new node at the end of the Doubly Linked List12) Java program to insert a new node at the middle of the Doubly Linked List13) Java program to remove duplicate elements from a Doubly Linked List14) Java program to rotate doubly linked list by N nodes15) Java program to search an element in a doubly linked list16) Java program to sort the elements of the doubly linked listJava Tree Programs1) Java Program to calculate the Difference between the Sum of the Odd Level and the Even Level Nodes of a Binary Tree2) Java program to construct a Binary Search Tree and perform deletion and In-order traversal3) Java program to convert Binary Tree to Binary Search Tree4) Java program to determine whether all leaves are at same level5) Java program to determine whether two trees are identical6) Java program to find maximum width of a binary tree7) Java program to find the largest element in a Binary Tree8) Java program to find the maximum depth or height of a tree9) Java program to find the nodes which are at the maximum distance in a Binary Tree10) Java program to find the smallest element in a tree11) Java program to find the sum of all the nodes of a binary tree12) Java program to find the total number of possible Binary Search Trees with N keys13) Java program to implement Binary Tree using the Linked List14) Java program to search a node in a Binary Tree
Next TopicJava OOPs Concepts
![]() Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
December 2022
Categories |