0% found this document useful (0 votes)
185 views3 pages

Write A Program To Store and Display Your Information

The document contains code for 3 programs - one to store and display user information, one to calculate simple interest, and one to check if a number is odd or even. Each program section includes the source code, inputs from the user, and outputs displayed to the user.

Uploaded by

NikinChitrakar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
185 views3 pages

Write A Program To Store and Display Your Information

The document contains code for 3 programs - one to store and display user information, one to calculate simple interest, and one to check if a number is odd or even. Each program section includes the source code, inputs from the user, and outputs displayed to the user.

Uploaded by

NikinChitrakar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Write A Program to store and display your information.

Source Code:
Console.WriteLine("Hello world")
Console.ReadLine()
Dim name As String
Dim age As Integer
Dim address As String
Console.WriteLine("Enter your name")
name = Console.ReadLine()
Console.WriteLine("Enter your age")
age = Console.ReadLine()
Console.WriteLine("Enter your address")
address = Console.ReadLine()
Console.WriteLine("your name is " & name)
Console.WriteLine("your age is " & age)
Console.WriteLine("your address is " & address)
Console.ReadLine()

Output:

Write a program to find simple interest.


Source code:
Sub Main()
Dim p As Integer
Dim t As Integer
Dim r As Integer
Dim i As Integer
Console.WriteLine("Enter the principle")
p = Console.ReadLine()
Console.WriteLine("Enter the time")
t = Console.ReadLine()
Console.WriteLine("Enter the rate")
r = Console.ReadLine()
i = (p * t * r) / 100
Console.WriteLine("the interest is " & i)
Console.ReadLine()

Output:

Write the program to check if the given number is odd or even.


Source code:
Sub Main()
Dim i As Integer
Dim a As Integer
Console.WriteLine("Enter the number")
i = Console.ReadLine()
a = i Mod 2
If a = 0 Then
Console.WriteLine("tthe given number is even ")
Else
Console.WriteLine("the given number is odd")
End If
Console.ReadLine()
End Sub

Output:

You might also like