in C#
What Will Be The Output Of The Following Code Snippet:?
using System;
namespace ProgrammingExercise
{
class FindOutput
{
static void Main(string[] args)
{
int i;
int div = 8, num = 32;
for (i = 0; i <= 10; i++)
{
if ((num / div * 3)== 6)
{
Console.WriteLine( i + " ");
continue;
}
else if (i != 5)
Console.Write(i + " ");
else
break;
}
Console.ReadLine();
}
}
}
// Screenshot of the code & output
// Code to copy
using System;
namespace ProgrammingExercise
{
class FindOutput
{
static void Main(string[] args)
{
int i;
int div = 8, num = 32;
for (i = 0; i <= 10; i++)
{
if ((num / div * 3)== 6)
{
Console.WriteLine( i + " ");
continue;
}
else if (i != 5)
Console.Write(i + " ");
else
break;
}
Console.ReadLine();
}
}
}
Output:
0 1 2 3 4
Get Answers For Free
Most questions answered within 1 hours.