hello
i have writing a program in c# , in this program i have display number 1 to 50 , but now i wanted to display "bizz" word instead of all 3's table (like 3,6,9,12) and 5's table (like 5,10,15,) number example my program output will look like this:
1
2
Bizz
4
Fizz
Bizz
7
8
Bizz
Fizz
please help
Pankaj Kumar ChoudharyPosted Jun 12, 2015, 6:30 AM
{
int count;
for (count = 1; count <= 50; count++)
{
if ((count % 3 == 0) && (count % 5 != 0))
Console.WriteLine("Bizz");
else if ((count % 3 != 0) && (count % 5 == 0))
Console.WriteLine("Fizz");
else if((count % 3 == 0) && (count % 5 == 0))
Console.WriteLine(" Bizz Fizz");
else
Console.WriteLine(count.ToString());
}
Console.ReadLine();
}
Nitin SharmaPosted Jun 12, 2015, 6:38 AM
Nitin SharmaPosted Jun 12, 2015, 6:23 AM
Pankaj Kumar ChoudharyPosted Jun 12, 2015, 6:17 AM