Wednesday 17 January 2018

Core Java Practice Program for Beginners

Write a program to find out the number of illiterate men from the population of 80,000 people. From the total population,52% are men, out of which only 35% are literate.

Answer:- 



public class Population {

public static void main(String[] args) {
int population = 80000;
int men,literate,illiterate;
men = 52 * population / 100;
literate = 35 * men / 100;
illiterate = men - literate ;
System.out.println("------------------------------------------------");
System.out.println("Total Men ="+men);
System.out.println("Total literate men ="+literate);
System.out.println("Total illiterate men ="+illiterate);
System.out.println("------------------------------------------------");
}

}

No comments:

Post a Comment

Error While embed the video in Your website page

Error:- Refused to display '<URL>' in a frame because it set 'X-Frame-Options' to 'sameorigin Solution:- if ...