Hi po paturo naman neto kanina pako nahirapan neto eh. Sumakit na ulo ko puro failed . Ang hirap sobra.
Willing to give tip sa makakabigay ng code.
Eto po dapat output niya.
1.
Public Sub Main(args() As string)
Dim n, i, j As Integer
Dim m As Integer = 1
Console.WriteLine(" Enter the number of rows")
n = Console.ReadLine() ' take an input from the user
For i = 1 To n ' outer loop decremented by 1
For j = 1 To i ' value of j is less than i
Console.Write("{0} ", j) ' print the value of i
Next
Console.WriteLine("") ' jump to next line at each iteration
Next
Console.Readline()
End Sub
End Module
TASK 1
For r = 1 to 9
For c=r to 9
PRINT C
PRINT " "
EndFor
PRINT "\N"
EndFor
TASK 2
For r = 10 to 1
For c=r to 10
PRINT C
PRINT " "
EndFor
PRINT "\N"
EndFor
Yaboku Translation to C# sa answer ni laxus456 para mas madali mong matranslate to VB.Net
C#:
Console.Write("Enter a number: ");
int num = Convert.ToInt32(Console.ReadLine());
int i, j;
for (i = 0; i < num; i++){
for (j = i + 1; j < num + 1; j++){
Console.Write(j + "\t");
if (j == num){
Console.WriteLine("");
}
}
}
C#:
Console.Write("Enter a number: ");
int num = Convert.ToInt32(Console.ReadLine());
int i, j;
for (i = 0; i < num; i++){
for (j = num - i; j < num + 1; j++){
Console.Write(j + "\t");
if (j == total){
Console.WriteLine("");
}
}
}
TASK 1
For r = 1 to 9
For c=r to 9
PRINT C
PRINT " "
EndFor
PRINT "\N"
EndFor
TASK 2
For r = 10 to 1
For c=r to 10
PRINT C
PRINT " "
EndFor
PRINT "\N"
EndFor
Eto try mo sa VB.Net (Translated from C++)
All credit to laxus456
Nakisali lang ako walang magawa eh =D
C#:
Public Module Program
Public Sub Main(args() As string)
Dim num As Integer = 0
Console.Write("Enter an integer value: ")
num = Convert.ToInt32(Console.ReadLine())
Dim i, j As Integer
For i = 0 To num - 1
For j = i + 1 To num + 1 - 1
Console.Write(j & vbTab)
If j = num Then
Console.WriteLine("")
End If
Next
Next
End Sub
End Module
C#:
Public Module Program
Public Sub Main(args() As string)
Dim num As Integer = 0
Console.Write("Enter an integer value: ")
num = Convert.ToInt32(Console.ReadLine())
Dim i, j As Integer
For i = 0 To num - 1
For j = num - i To num + 1 - 1
Console.Write(j & vbTab)
If j = num Then
Console.WriteLine("")
End If
Next
Next
End Sub
End Module
TASK 1
For r = 1 to 9
For c=r to 9
PRINT C
PRINT " "
EndFor
PRINT "\N"
EndFor
TASK 2
For r = 10 to 1
For c=r to 10
PRINT C
PRINT " "
EndFor
PRINT "\N"
EndFor
Eto try mo sa VB.Net (Translated from C++)
All credit to laxus456
Nakisali lang ako walang magawa eh =D
C#:
Public Module Program
Public Sub Main(args() As string)
Dim num As Integer = 0
Console.Write("Enter an integer value: ")
num = Convert.ToInt32(Console.ReadLine())
Dim i, j As Integer
For i = 0 To num - 1
For j = i + 1 To num + 1 - 1
Console.Write(j & vbTab)
If j = num Then
Console.WriteLine("")
End If
Next
Next
End Sub
End Module
C#:
Public Module Program
Public Sub Main(args() As string)
Dim num As Integer = 0
Console.Write("Enter an integer value: ")
num = Convert.ToInt32(Console.ReadLine())
Dim i, j As Integer
For i = 0 To num - 1
For j = num - i To num + 1 - 1
Console.Write(j & vbTab)
If j = num Then
Console.WriteLine("")
End If
Next
Next
End Sub
End Module
Module Module1
Sub Main()
Dim n, i, j As Integer
Dim m As Integer = 1
Console.WriteLine(" Enter the number of rows")
n = Console.ReadLine() ' take an input from the user
For i = n To 1 Step -1
For j = i To n
Console.Write("{0} ", j)
Next
Console.WriteLine("")
Next
Console.ReadLine()
End Sub
End Module
Eto try mo sa VB.Net (Translated from C++)
All credit to laxus456
Nakisali lang ako walang magawa eh =D
C#:
Public Module Program
Public Sub Main(args() As string)
Dim num As Integer = 0
Console.Write("Enter an integer value: ")
num = Convert.ToInt32(Console.ReadLine())
Dim i, j As Integer
For i = 0 To num - 1
For j = i + 1 To num + 1 - 1
Console.Write(j & vbTab)
If j = num Then
Console.WriteLine("")
End If
Next
Next
End Sub
End Module
C#:
Public Module Program
Public Sub Main(args() As string)
Dim num As Integer = 0
Console.Write("Enter an integer value: ")
num = Convert.ToInt32(Console.ReadLine())
Dim i, j As Integer
For i = 0 To num - 1
For j = num - i To num + 1 - 1
Console.Write(j & vbTab)
If j = num Then
Console.WriteLine("")
End If
Next
Next
End Sub
End Module
Thanks pero credit kay laxus456
Also pwede rin actually di na icheck kung equal yung j sa num. Direct Console.Writeline nalang after Next
C#:
Dim num As Integer = 0
Console.Write("Enter an integer value: ")
num = Convert.ToInt32(Console.ReadLine())
Dim i, j As Integer
For i = 0 To num - 1
For j = num - i To num + 1 - 1
Console.Write(j & vbTab)
Next
Console.WriteLine("")
Next