What's new

Closed A program that reads integer in vb.net

Status
Not open for further replies.

TABILIN

Honorary Poster
Joined
Jan 10, 2016
Posts
599
Solutions
1
Reaction
63
Points
203
mga kaPHC andto na nman ako patulong po sa homework ko
Write a program that reads an integer between 0 and 1000 and add all the digits in the integer. For example, if an integer is 932, the sum of all its digits is 14. gamit ang vb.net salamat po sa tutulong :)
 
di ko po alam mag array boss.pinagawa lang samin ..:(
di narin ako marunong e, haha wala din akong visual studio pasensya na di ko matatry, pero ganun lang logic dun, try po kayo magresearch, para kung sakaling di pa natuturo sa inyo, e advanced ka na...:cool:
 
mam paano gawing 10 per line to
upload_2017-2-24_10-48-3.png
 

Attachments

Give me the specific problem kuya.. hndi po ako output based.. kasi minsan mali yung output.. problem based po ako nagcocode talaga.. ;)
Write a program that displays all the numbers from 0 to 200, ten per line, that are divisible by 5 or 6, but not both. yan po mam problem..mraming salamat sa iyo mam :)
 
Code:
Dim testRange As Integer
        Dim counter As Integer = 1
        For testRange = 0 To 200
            If testRange Mod 5 = 0 Or testRange Mod 6 = 0 Then
                If counter <= 10 Then
                    Console.Write(" " & testRange)
                    counter += 1
                Else
                    Console.WriteLine()
                    counter = 1
                End If
            End If
        Next
salamat po mam :)
 
Code:
Dim testRange As Integer
        Dim counter As Integer = 1
        For testRange = 0 To 200
            If testRange Mod 5 = 0 Or testRange Mod 6 = 0 Then
                If counter <= 10 Then
                    Console.Write(" " & testRange)
                    counter += 1
                Else
                    Console.WriteLine()
                    counter = 1
                End If
            End If
        Next
Mam last no po ito ano po problema code ko
Sub Main()
Dim i, j As Integer
For i = 1 To 6
For j = 1 To i
Console.Write(j & " ")
Next
Console.WriteLine()
Next
Console.ReadKey()
End Sub
kapag nirun ko po ito ganito po output

1
12
123
1234
12345
123456
dapat ganito sana mam tulungan nyo ako kailangan ko ipass mamaya huhu :( last na po ito mam salamat po
123456
12345
1234
123
12
1
 
Mam last no po ito ano po problema code ko
Sub Main()
Dim i, j As Integer
For i = 1 To 6
For j = 1 To i
Console.Write(j & " ")
Next
Console.WriteLine()
Next
Console.ReadKey()
End Sub
kapag nirun ko po ito ganito po output

1
12
123
1234
12345
123456
dapat ganito sana mam tulungan nyo ako kailangan ko ipass mamaya huhu :( last na po ito mam salamat po
123456
12345
1234
123
12
1

Reverse mo si outer loop mo kuya ;)

Code:
Dim outer, inner As Integer
        For outer = 6 To 1 Step -1
            For inner = 1 To outer
                Console.Write(inner)
            Next
            Console.WriteLine()
        Next
        Console.ReadKey()
 
Status
Not open for further replies.

Similar threads

Back
Top