BCA Raipur - BCA Notes S-1

Post your notes and other just by mailing us at bcaraipur@live.com

BCA Raipur - BCA Notes S-2

Post your notes and other just by mailing us at bcaraipur@live.com

BCA Raipur - BCA Notes S-3

Post your notes and other just by mailing us at bcaraipur@live.com

BCA Raipur - BCA Notes S-4

Post your notes and other just by mailing us at bcaraipur@live.com

BCA Raipur - BCA Notes S-5

Post your notes and other just by mailing us at bcaraipur@live.com

google search

Popular Posts


Welcome to BCA Notes

>>>>>>>>>>>>>>>>

Visitors

Search This Blog

Blogger templates

Visitor Map


Thursday 29 January 2015

Program to take input an array of names(String) and then display it. (on console)



Program to take input an array of names(String) and then display it.
(on console)
Source code:-

Module Module1

    Sub Main()
        Dim name(5) As String
        Dim i As Integer
        For i = 0 To 4
            Console.Write("Enter the name of{0}:", i + 1)
            name(i) = Console.ReadLine()
        Next
        For i = 0 To 4
            Console.Write("The name of {0} is:", i + 1)
            Console.WriteLine(name(i))
        Next
        Console.ReadLine()
    End Sub
End Module

Program to arrange integer in increasing order Console Application

Program to arrange integer in increasing order
Console Application

Source code:-
Module Module1
    Sub Main()
        Dim arr(4), arr1(4) As Integer
        Dim i As Integer
        For i = 0 To arr.Length - 1
            Console.WriteLine("Enter {0} element of array:", i + 1)
            arr(i) = Convert.ToInt32(Console.ReadLine())
        Next
        Array.Copy(arr, arr1, arr1.Length)
        'Array.Copy(source, destination, Destination Length)
        Array.Sort(arr1)
        For i = 0 To arr1.Length - 1
            Console.Write("Enter {0} element of array in Reverse order:", i + 1)
            Console.WriteLine(arr1(i))
        Next
        Console.ReadLine()
    End Sub
End Module

Output:-