ja_mario14
Addict
- Joined
- Apr 1, 2022
- Posts
- 102
- Reaction
- 16
- Points
- 89
using System;
class program
{
static void Main()
{
int i, num, sum=0, total=0;
for(i=1;i<10;i++)
{
Console.Write("Enter Number: ");
num = Convert.ToInt32(Console.ReadLine());
if(num%2==0)
{
sum+=num;
}
}
Console.Write("\n\nSum of Number Divisible By 2: {0} \n",sum);
if(num%2==0)
{
total = num+i;
}
Console.WriteLine("Total Number Divisible By 2: {0} \n",total);
}
}
Here is the question problem.
class program
{
static void Main()
{
int i, num, sum=0, total=0;
for(i=1;i<10;i++)
{
Console.Write("Enter Number: ");
num = Convert.ToInt32(Console.ReadLine());
if(num%2==0)
{
sum+=num;
}
}
Console.Write("\n\nSum of Number Divisible By 2: {0} \n",sum);
if(num%2==0)
{
total = num+i;
}
Console.WriteLine("Total Number Divisible By 2: {0} \n",total);
}
}
Here is the question problem.
Attachments
-
You do not have permission to view the full content of this post. Log in or register now.
Last edited: