xxxxxxxxxx
Writer fileWriter = new FileWriter("c:\\data\\output.txt", true); //appends to file
Writer fileWriter = new FileWriter("c:\\data\\output.txt", false); //overwrites file
xxxxxxxxxx
public class loop {
public static void main(String[] args)
{
int i=5;
int sum=0;
int count=0;
while(i<=100)
{
if(i%10==0 && i%3!=0)
{
sum+=i;
count++;
}
i=i+5;
}
double average=(sum*1.0)/count;
System.out.printf("The average is %.2f",average);
}
}
xxxxxxxxxx
int t;
LinkedList<Vertex> V;
int CPL;
static int topNumber;
boolean isDAG;