Sunday 16 August 2015

In a town,the percentage of men is 52.The percentage of total literacy is 48.If total percentage of literate men is 35 of the total populations,WAP in java to find the total no of illiterate men and women ,if the population of the town is 80000.

//Population=80000,Men=52% of population,Literate people=48% of population, Literate Men=35% of Population
//Program to display count of illiterate men and illiterate women

class Population {

public static void main(String args[])
{
long pop=80000,ilm,ilw;

ilm=(long)((0.52*pop)-(0.35*pop)); //Illiterate men
ilw=(long)((0.52*pop)-ilm); //Illiterate women

System.out.println("Population:"+pop);
System.out.println("Illiterate men:"+ilm);
System.out.println("Illiterate women:"+ilw);
}

}

No comments:

Post a Comment