Skip to content

Add files via upload #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions A level vb.net/lab2/Looping statementsq.(8-14)/1 3 5 (while).vb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Module Module1

Sub Main()
Dim a, n As Integer
a = 2
Console.WriteLine(" enter the number of digits you want to print")
n = Console.ReadLine()
Do
Console.Write(a & ",")
a = a + 2
n = n - 1
Loop Until n <> 0


Console.ReadKey()
End Sub

End Module
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Module Module1

Sub Main()
Dim name As String
Dim a As Integer

a = 10
Console.WriteLine("enter your name")
name = Console.ReadLine()

While a <> 0
Console.WriteLine(name)
a = a - 1
End While
Console.ReadLine()
End Sub

End Module
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Module Module1

Sub Main()
Dim a, n As Integer
a = 2
Console.WriteLine(" enter the number of digits you want to print")
n = Console.ReadLine()
While n <> 0
Console.Write(a & ",")
a = a + 2
n = n - 1
End While

Console.ReadKey()

End Sub

End Module
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Module Module1

Sub Main()
Dim n, a As Integer
n = 5
a = 1
While a <= 10
Console.Write(n & " ")
n = n + 4
a = a + 1
End While
Console.ReadKey()
End Sub

End Module
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Module Module1

Sub Main()
Dim n, sum As Integer
Console.WriteLine("enter a number")
n = Console.ReadLine
While n <> 0
sum = sum + n
n = n - 1
End While
Console.WriteLine("The cumulative sum upto given number = " & sum)
Console.ReadKey()
End Sub

End Module
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Module Module1

Sub Main()
Dim a, n, multiple As Integer
Console.WriteLine("enter the number whose multiplication table you want to know")
n = Console.ReadLine()
a = 1
While a <= 10
multiple = n * 1
Console.WriteLine(n & "*" & a & "=" & multiple)
a = a + 1
End While
Console.ReadKey()
End Sub

End Module
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Module Module1

Sub Main()
Dim a, b, c, n As Integer
Console.WriteLine("enter the number")
n = Console.ReadLine
a = 1
b = 1
Console.Write(a & " " & b & " ")
While n <> 0
c = a + b
Console.Write(c & " ")
a = b
b = c
n = n - 1
End While
Console.ReadKey()
End Sub

End Module
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Module Module1

Sub Main()
Dim a, b, c, n As Integer
a = 1
b = 1
Console.WriteLine("enter the number of digits you want to print in fibonacci series")
n = Console.ReadLine()
n = n - 2
Console.Write(a & "," & b & ", ")
While n <> 0
c = a + b
Console.Write(c & ",")
a = b
b = c
n = n - 1
End While
Console.ReadLine()

End Sub

End Module