ashu
BAN USER
Comments (3)
Reputation 0
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
0
of 0 vote
private static void method1()
{
Console.Write("Enter the no. : ");
Int16 num = Convert.ToInt16(Console.ReadLine());
if (num >= 3)
{
for (Int16 i = 1; i < num + 1; i++)
{
if (i % 3 == 0 && i % 5 == 0) Console.WriteLine("FizzBuzz");
else if (i % 3 == 0) Console.WriteLine("Fizz");
else if (i % 5 == 0) Console.WriteLine("Buzz");
else Console.WriteLine(i);
}
}
else Console.WriteLine("enter a valid no..");
}
- ashu December 09, 2013Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
- ashu October 08, 2014