try this
class Program
{
public static void Main(string[] args)
{
for (int i = 1; i <= 100; i++)
{
int j=i;
if ((i % 3 == 0) && (i % 5 != 0))
j = 3;
else if ((i % 5 == 0) && (i % 3 != 0))
j = 5;
else if ((i % 5 == 0) && (i % 3 == 0))
j = 35;
Console.WriteLine(j);
}
Console.ReadLine();
}
}