Public Sub Main(args() As string)tingin ako code mo sir
#include <stdio.h>
int main(){
int n=0;
printf("enter a number: "); scanf("%d", &n);
for(int i=0;i<n;i++){
for(int j=i+1;j<n+1;j++){
printf("%d\t", j);
if(j==n){
printf("\n");
}
}
}
printf("\n\n\n\n");
for(int i=0;i<n;i++){
for(int j=n-i;j<n+1;j++){
printf("%d\t", j);
if(j==n){
printf("\n");
}
}
}
}
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("");
}
}
}
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("");
}
}
}
Bat 10 po sa task 2?Good Luck!Code: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
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
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
Kuya pm poGood Luck!Code: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
Thank you poEto 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
Up dito, di ganyan code ko pero this works perfectly hahahahahahahahaEto 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
Up dito, di ganyan code ko pero this works perfectly hahahahahahahaha
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
Thank you posir ayos lang sayo ibang programming language, di ko alam vb net pero alam ko yung logic niyang program na yan
C program code:
C:#include <stdio.h> int main(){ int n=0; printf("enter a number: "); scanf("%d", &n); for(int i=0;i<n;i++){ for(int j=i+1;j<n+1;j++){ printf("%d\t", j); if(j==n){ printf("\n"); } } } printf("\n\n\n\n"); for(int i=0;i<n;i++){ for(int j=n-i;j<n+1;j++){ printf("%d\t", j); if(j==n){ printf("\n"); } } } }
C program Ouput
View attachment 1882458