ADVERTISEMENT
ADVERTISEMENT

VB.Net program to demonstrate the Oct() function

Here, we are going to demonstrate the Oct() function in VB.Net.
Submitted by Nidhi, on December 04, 2020

The Oct() function is used to get the Octal value corresponding specified number.

Syntax:

Oct(num)

Parameters:

  • num: Specified integer number.

Return Value:

The Oct() function will return the Octal value corresponding specified integer number.

Program/Source Code:

The source code to demonstrate the Oct() function is given below. The given program is compiled and executed successfully.

'VB.Net program to demonstrate the Oct() function.

Module Module1
    Sub Main()
        Dim val As Integer = 13
        Dim OctalVal As String = ""

        OctalVal = Oct(val)

        Console.WriteLine("Octal value: {0}", OctalVal)
    End Sub

End Module

Output:

Octal value: 15
Press any key to continue . . .

Explanation:

In the above program, we created a module Module1 that contains a Main() method. In the Main() method, we created two variables val and OctalVal. Here, variable val is initialized with 13 and variable OctalVal is initialized with a blank string.

OctalVal = Oct(val)

In the above code, we used Oct() function that will return the octal value corresponding to the specified integer number. Then we printed the character on the console screen.

VB.Net Basic Programs »



ADVERTISEMENT




ADVERTISEMENT



Comments and Discussions!

ADVERTISEMENT

ADVERTISEMENT

ADVERTISEMENT

ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT

Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.