Programing made easy
Friday, December 23, 2011
Program to
public class Ch2Q25
{
public static void main(String[] args)
{double mohan = 1000, vidya = 750;
int yr = 0;
while(vidya <= mohan)
{ mohan += 100;
vidya += 0.075 * vidya;
yr++;
}
System.out.println("\nNo of years= "+yr);
}
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment