ja_mario14
Addict
Paano ko po mapapadisplay ng ganito yung output, naattach po yung image ng result ng code ko tyka po
yung correct output ng application program sa ibaba. sana po matulungan niyo po ako.
============================================
using System;
class Program
{
static void Main() {
int i, sumPositive=0, sumNegative=0, countPositive=0, countNegative=0;
int[] arr = new int[10];
for(i=0;i<10;i++)
{
Console.Write("Enter Number: ");
arr = Convert.ToInt32(Console.ReadLine());
}
Console.Write("\nThe following are the numbers you entered:"+"\n\n");
for(i=0;i<10;i++)
{
Console.Write("{0} ", arr);
if(arr>0)
{
countPositive++;
sumPositive++;
}
if(arr<0)
{
countNegative++;
sumNegative++;
}
}
Console.Write("\n\nPositive Numbers: "+countPositive);
Console.Write("\nTotal Positive Numbers: "+sumPositive);
Console.Write("\n\nNegative Numbers: "+countNegative);
Console.Write("\nTotal Negative Numbers: "+sumNegative);
}
}
====================================================
PS. pasensya na po, di ko po mailagay yung code sa proper code text kasi wala po akong button.
Thank you in advance po mga master. God bless.
yung correct output ng application program sa ibaba. sana po matulungan niyo po ako.
============================================
using System;
class Program
{
static void Main() {
int i, sumPositive=0, sumNegative=0, countPositive=0, countNegative=0;
int[] arr = new int[10];
for(i=0;i<10;i++)
{
Console.Write("Enter Number: ");
arr = Convert.ToInt32(Console.ReadLine());
}
Console.Write("\nThe following are the numbers you entered:"+"\n\n");
for(i=0;i<10;i++)
{
Console.Write("{0} ", arr);
if(arr>0)
{
countPositive++;
sumPositive++;
}
if(arr<0)
{
countNegative++;
sumNegative++;
}
}
Console.Write("\n\nPositive Numbers: "+countPositive);
Console.Write("\nTotal Positive Numbers: "+sumPositive);
Console.Write("\n\nNegative Numbers: "+countNegative);
Console.Write("\nTotal Negative Numbers: "+sumNegative);
}
}
====================================================
PS. pasensya na po, di ko po mailagay yung code sa proper code text kasi wala po akong button.
Thank you in advance po mga master. God bless.
Attachments
-
You do not have permission to view the full content of this post. Log in or register now.