40% DISCOUNT LIMITED SEATS
Java Full Stack + AI Industrial Training 2026
Expert MNC Mentors • Industrial Roadmap • 10 Seats Left
GitHub
Month 01: Lab Setup

Java & GitHub

  • Java 21 & IntelliJ AI Mastery
  • GitHub Team Industrial Flow
  • MNC Standard VS Code Setup
Logic
Month 02: Logic Lab

Logic Mastery

  • Complex DSA with MNC Experts
  • Telugu & English Logic Bridge
  • Daily Problem Solving Drills
Backend
Month 03: API Hub

Spring & SQL

  • Spring Boot 3 Microservices
  • Postman API Automated Testing
  • PostgreSQL DB Architecture
Frontend
Month 04: UI Factory

React & Tailwind

  • React 18 & AI Component Dev
  • Industrial Tailwind UI Library
  • Redux State Management
Cloud
Month 05: Deploy

AWS & Jira Hub

  • Cloud Deploy on Real AWS
  • Agile Scrum with Jira Tools
  • Jenkins CI/CD Pipeline
Success
Month 06: Result

Job Offer Letter

  • Tier-1 MNC Direct Referrals
  • Salary Negotiation Strategy
  • High CTC Placement Pipeline

Write a JAVA program to display number of even and odd digits available in given Number? | code-5 |important java programs |StudyEcart

Yogi Siddeswara 0

 Q. Write a JAVA program to display a number of even and odd digits available in a given Number?

package impprograms;

import java.util.Scanner;

public class FindEvenOdd {

	public static void main(String[] args) {
    
    int evendigit=0,oddigit=0;
	Scanner scan=new Scanner(System.in);
    System.out.println("Please Enter a Number :");
	int val=scan.nextInt();
 
	while(val!=0) {
     int temp=val%10;
if(temp%2==0)
	evendigit++;
else
	oddigit++;

     val=val/10;
	}
	
 System.out.println(" \n *** Total number of Even Digits of given number is : "+evendigit);
 System.out.println(" \n *** Total number of Odd Digits of given number is : "+oddigit);
 scan.close();
	}

}

Note: you can drag the code workspace to see the complete code

Post a Comment

0 Comments