Maya R

Maya R

  • NA
  • 9
  • 980

What would be the output for this program?

Oct 20 2018 4:39 AM
and how many times would it run?I'm not allowed to run it because the assignment is to figure out by just looking at it. Please explain because I need to understand why. Thanks!
 
Console.WriteLine("\n--------- 8");
int sum=0;
bool found = false;
for (int i = 1; ! found; i++ )
{
Console.WriteLine("Enter Num");
x = int.Parse(Console.ReadLine());
if (x % 2 == 0 && x % 4 != 0)
sum = sum + x;
if (x < 0)
found = true;

Answers (1)