SlideShare a Scribd company logo
1 of 2
Imports System
Public Class tables
Private a As Integer
Private b As Integer
Private c As Integer
Private v As Integer
Public Sub two()
a = 1
b = 2
While a <= 20
c = a * b
Console.WriteLine(c)
Console.ReadLine()
a = a + 1
End While
End Sub
Public Sub three()
a = 1
b = 3
Do
c = a * b
Console.WriteLine(c)
Console.ReadLine()
a = a + 1
Loop While a <= 20
Exit Sub
End Sub
Public Sub four()
Dim s As Integer
Dim e As Integer
v = 1
s = 1
b = 4
e = 20
For v As Integer = s To e
c = v * b
Console.WriteLine(c)
Console.ReadLine()
v = v + 1
Next v
End Sub
End Class
Module module1
Sub Main()
Dim t As New tables()
Console.WriteLine("enter your choice")
Console.WriteLine("two")
Console.WriteLine("three")
Console.WriteLine("four")
Dim ch As String = Console.ReadLine()
Console.ReadLine()
Select Case ch
Case "two"
t.two()
Case "three"
t.three()
Case "four"
t.four()
Case Else
Console.WriteLine("unknown")
End Select
End Sub
End Module

More Related Content

What's hot

การหาปริมาตรของปร ซึม
การหาปริมาตรของปร ซึมการหาปริมาตรของปร ซึม
การหาปริมาตรของปร ซึม
Pairy Little
 
DOAG: Visual SQL Tuning
DOAG: Visual SQL TuningDOAG: Visual SQL Tuning
DOAG: Visual SQL Tuning
Kyle Hailey
 
computer notes - Data Structures - 35
computer notes - Data Structures - 35computer notes - Data Structures - 35
computer notes - Data Structures - 35
ecomputernotes
 
Computer architecture
Computer architectureComputer architecture
Computer architecture
Sanjeev Patel
 

What's hot (20)

Half Subtractor : Combiational Circuit
Half Subtractor : Combiational CircuitHalf Subtractor : Combiational Circuit
Half Subtractor : Combiational Circuit
 
Computer notes - Hashing
Computer notes - HashingComputer notes - Hashing
Computer notes - Hashing
 
Topological sort
Topological sortTopological sort
Topological sort
 
Lecture 2 f17
Lecture 2 f17Lecture 2 f17
Lecture 2 f17
 
C# example (Polymorphesim)
C# example (Polymorphesim)C# example (Polymorphesim)
C# example (Polymorphesim)
 
การหาปริมาตรของปร ซึม
การหาปริมาตรของปร ซึมการหาปริมาตรของปร ซึม
การหาปริมาตรของปร ซึม
 
Half & Full Adder
Half &  Full AdderHalf &  Full Adder
Half & Full Adder
 
logical circuits substractors
logical circuits substractors logical circuits substractors
logical circuits substractors
 
Shortcut keys
Shortcut keysShortcut keys
Shortcut keys
 
DOAG: Visual SQL Tuning
DOAG: Visual SQL TuningDOAG: Visual SQL Tuning
DOAG: Visual SQL Tuning
 
Create a correlation plot from joined tables and lag times
Create a correlation plot from joined tables and lag timesCreate a correlation plot from joined tables and lag times
Create a correlation plot from joined tables and lag times
 
正規表現のいろは
正規表現のいろは正規表現のいろは
正規表現のいろは
 
2 19-2018-mean of all runs
2 19-2018-mean of all runs2 19-2018-mean of all runs
2 19-2018-mean of all runs
 
computer notes - Data Structures - 35
computer notes - Data Structures - 35computer notes - Data Structures - 35
computer notes - Data Structures - 35
 
Computer architecture
Computer architectureComputer architecture
Computer architecture
 
Introduction to python programming
Introduction to python programmingIntroduction to python programming
Introduction to python programming
 
Lumpkin Graphing functions
Lumpkin Graphing functionsLumpkin Graphing functions
Lumpkin Graphing functions
 
Ch3
Ch3Ch3
Ch3
 
PART 5: RASTER DATA
PART 5: RASTER DATAPART 5: RASTER DATA
PART 5: RASTER DATA
 
Cs101 endsem 2014
Cs101 endsem 2014Cs101 endsem 2014
Cs101 endsem 2014
 

Similar to Looping

(Www.entrance exam.net)-tcs placement sample paper 2
(Www.entrance exam.net)-tcs placement sample paper 2(Www.entrance exam.net)-tcs placement sample paper 2
(Www.entrance exam.net)-tcs placement sample paper 2
Pamidimukkala Sivani
 

Similar to Looping (20)

AP PGECET Computer Science 2016 question paper
AP PGECET Computer Science 2016 question paperAP PGECET Computer Science 2016 question paper
AP PGECET Computer Science 2016 question paper
 
R-Data table Cheat Sheet
R-Data table Cheat SheetR-Data table Cheat Sheet
R-Data table Cheat Sheet
 
(Www.entrance exam.net)-tcs placement sample paper 2
(Www.entrance exam.net)-tcs placement sample paper 2(Www.entrance exam.net)-tcs placement sample paper 2
(Www.entrance exam.net)-tcs placement sample paper 2
 
Vb.net iii
Vb.net iiiVb.net iii
Vb.net iii
 
Gate-Cs 1996
Gate-Cs 1996Gate-Cs 1996
Gate-Cs 1996
 
Hems
HemsHems
Hems
 
Computer science sqp
Computer science sqpComputer science sqp
Computer science sqp
 
Vb.net programs
Vb.net programsVb.net programs
Vb.net programs
 
Technical aptitude test 2 CSE
Technical aptitude test 2 CSETechnical aptitude test 2 CSE
Technical aptitude test 2 CSE
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
 
Python programming workshop session 3
Python programming workshop session 3Python programming workshop session 3
Python programming workshop session 3
 
GVKCV Computer Science(083) Pre board sample paper 2 Class 12 (20-21) with so...
GVKCV Computer Science(083) Pre board sample paper 2 Class 12 (20-21) with so...GVKCV Computer Science(083) Pre board sample paper 2 Class 12 (20-21) with so...
GVKCV Computer Science(083) Pre board sample paper 2 Class 12 (20-21) with so...
 
Matlab solved problems
Matlab solved problemsMatlab solved problems
Matlab solved problems
 
Soln dc05
Soln dc05Soln dc05
Soln dc05
 
Stacks.ppt
Stacks.pptStacks.ppt
Stacks.ppt
 
Stacks.ppt
Stacks.pptStacks.ppt
Stacks.ppt
 
Visual Basic(Vb) practical
Visual Basic(Vb) practicalVisual Basic(Vb) practical
Visual Basic(Vb) practical
 
Number systems and Boolean Reduction
Number systems and Boolean ReductionNumber systems and Boolean Reduction
Number systems and Boolean Reduction
 
Lecture 2 coding_principles
Lecture 2 coding_principlesLecture 2 coding_principles
Lecture 2 coding_principles
 
Gate-Cs 1999
Gate-Cs 1999Gate-Cs 1999
Gate-Cs 1999
 

Looping

  • 1. Imports System Public Class tables Private a As Integer Private b As Integer Private c As Integer Private v As Integer Public Sub two() a = 1 b = 2 While a <= 20 c = a * b Console.WriteLine(c) Console.ReadLine() a = a + 1 End While End Sub Public Sub three() a = 1 b = 3 Do c = a * b Console.WriteLine(c) Console.ReadLine() a = a + 1 Loop While a <= 20 Exit Sub End Sub Public Sub four() Dim s As Integer Dim e As Integer v = 1 s = 1 b = 4 e = 20 For v As Integer = s To e c = v * b Console.WriteLine(c) Console.ReadLine() v = v + 1 Next v End Sub End Class Module module1 Sub Main() Dim t As New tables() Console.WriteLine("enter your choice") Console.WriteLine("two") Console.WriteLine("three") Console.WriteLine("four") Dim ch As String = Console.ReadLine() Console.ReadLine() Select Case ch Case "two" t.two()
  • 2. Case "three" t.three() Case "four" t.four() Case Else Console.WriteLine("unknown") End Select End Sub End Module