Java Program to Find the Sum of Even and Odd Numbers

This is a Java Program to Calculate the Sum of Odd & Even Numbers. Enter the number of elements you want in array. Now enter all the elements you want in that array. We begin from the first element and check if it is odd or even. Hence we add that number into the required … Read more

advertisement

Java Program to Check Whether a Character is a Vowel, Consonant or Digit

This is a Java Program to Check if a Given Character is Vowel or Consonant. Enter any character as an input. Now we match this character with the already defined vowels in switch case. If the given character matches with any of the vowels then output generated is vowel or else consonant as in a … Read more

advertisement

Java Program to Find the Largest Number Among Three Numbers

This is a Java Program to Find the Biggest of 3 Numbers. Enter any three integer numbers as an input. Now we check the first number against the second and third number. If it false then we check for second number against third. If it is also false then accordingly third number will be declared … Read more

advertisement

Java Program to Print Binary Equivalent of an Integer using Recursion

This is a Java Program to Print Binary Equivalent of an Integer using Recursion. Enter any integer number as an input. After that we pass the given number to the other function where by using modulo operator along with recursion we get the reverse of a number as an output. Here is the source code … Read more

advertisement

Java Program to Check if Bit Position is Set to One or not

This is a Java Program to Check if a given Bit Position is set to One or not. Enter any decimal number as an input. Also mention the bit position at which you want to check whether one is present or not. After that we first convert the given decimal number into binary number and … Read more

advertisement

Java Program to Count Set Bits using Bitwise Operations

This is a Java Program to Count the Number of Bits set to One. Enter any decimal number as an input. After that we first convert the given decimal number into binary number and then check at every position for 1. If 1 occurs then we increase the counter by one. Hence at last we … Read more

advertisement

Bitwise Operators in Java

This is a Java Program to Illustrate the Use of Various Bitwise Operators. Enter any two decimal numbers as an input. After that select any option from different available options to perform various biwise operations and get the desired output. Here is the source code of the Java Program to Illustrate the Use of Various … Read more

advertisement

Java Program to Convert Binary to Gray Code using Recursion

This is a Java Program to Convert Binary Code of a Number into its Equivalent Gray’s Code Using Recursion. Gray code is a binary numeral system where two successive values differ in only one bit. Enter any binary number as an input. Now we pass the gven number along wth zero to different function where … Read more

advertisement

Java Program to Find Sum of Digits of a Number using Recursion

This is a Java Program to Find Sum of Digits of a Number using Recursion. Enter any Decimal number as an input. Now we pass that number to a new functon where we use modulo operator to find sum of digits as ouput along with the help of recursion. Here is the source code of … Read more

advertisement

Sum of Natural Numbers using Recursion in Java

This is a Java Program to Find Sum of N Numbers using Recursion. Enter the number of elements you want and then enter all the required elements as an input. Now we pass all the elements along with the length of array and a zero to new function where we find sum of all the … Read more

advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.