Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

AAAA

Module Module1
    Function FillArr(ByVal arr() As Double) As Integer
        For i As Integer = 0 To arr.Length() - 1
            arr(i) = CDbl(Console.ReadLine())
        Next
        Return 0
    End Function
    Function SwitchArr(ByVal arr() As Double) As Integer
        Dim count As Integer = 0
        For i As Integer = 0 To arr.Length() - 1
            If arr(i) < 0 Then arr(i) = 0 
            count += 1

        Next
        return count
    End Function
    
    Function PrintArr(ByVal arr() As Double) As Integer

        For i As Integer = 0 To arr.Length() - 1
            Console.Write(arr(i) & " ")
        Next
        Console.WriteLine()
        Return 0
    End Function



    Sub Main()
        Dim n As Integer = CInt(Console.ReadLine())
        Dim arr(n - 1) As Double
        FillArr(arr)
        Dim res as integer = SwitchArr(arr)
        PrintArr(arr)
        Console.WriteLine(res)
        Console.ReadKey()


    End Sub

End Module

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.