What's new

C# Code: Please help, patulong lang po kung paano ko mapapalabas ganitong output.

ja_mario14

Established
Joined
Apr 1, 2022
Posts
58
Reaction
13
Eto po yung code and yung correct output, pls help.

c.png q.png
 

Attachments

1nn0c3ntv5

Enthusiast
C#:
using System;

class program
{

    static void Main()
    {
        
        for (int firstRowNumber = 1; firstRowNumber <= 10; firstRowNumber++)
        {
            Console.WriteLine($"{firstRowNumber}\t{(firstRowNumber * 10) - (11 * firstRowNumber - 11) }");
        }
    }
}
 

ja_mario14

Established
sir alisin mo ung for loop ng j pwede gawin mo gawin mo value ni j=11 tapos minus mo na lang si value ng i
Pwede po mag pa-construct. tinatry ko po pero di ko pa rin po makuha.


using System;

class program

{
static void Main()
{
int i,j;

for(i=1;i<=10;i++)
{
for(j=i;j>=i;j--)
Console.Write("{0} {1}",i,j);
Console.Write("\n");
}
}
}

C#:
using System;

class program
{

    static void Main()
    {
       
        for (int firstRowNumber = 1; firstRowNumber <= 10; firstRowNumber++)
        {
            Console.WriteLine($"{firstRowNumber}\t{(firstRowNumber * 10) - (11 * firstRowNumber - 11) }");
        }
    }
}

thank you po sir.
 

1nn0c3ntv5

Enthusiast
ito na lang para any number

C#:
using System;

class program
{

    static void Main()
    {
        const int MAX_NUM = 10;

        for (int currentNumber = 1; currentNumber <= MAX_NUM; currentNumber++)
        {
            Console.Write(currentNumber);
            Console.Write("\t");
            Console.WriteLine((currentNumber * MAX_NUM)- (((MAX_NUM + 1) * currentNumber) - (MAX_NUM + 1)));
        }

    }
}
 

ja_mario14

Established
ito na lang para any number

C#:
using System;

class program
{

    static void Main()
    {
        const int MAX_NUM = 10;

        for (int currentNumber = 1; currentNumber <= MAX_NUM; currentNumber++)
        {
            Console.Write(currentNumber);
            Console.Write("\t");
            Console.WriteLine((currentNumber * MAX_NUM)- (((MAX_NUM + 1) * currentNumber) - (MAX_NUM + 1)));
        }

    }
}
okii, noted po. Thank you po sir.

ito na lang para any number

C#:
using System;

class program
{

    static void Main()
    {
        const int MAX_NUM = 10;

        for (int currentNumber = 1; currentNumber <= MAX_NUM; currentNumber++)
        {
            Console.Write(currentNumber);
            Console.Write("\t");
            Console.WriteLine((currentNumber * MAX_NUM)- (((MAX_NUM + 1) * currentNumber) - (MAX_NUM + 1)));
        }

    }
}


Sge po sir. salamat po.
 
Top