Study guides

☆☆

Q: How do you write a program in BASIC to find the GCD and LCM of two integer numbers?

Write your answer...

Submit

Still have questions?

Related questions

' Return the maximum of a,b,c Function max(ByVal a As Integer, ByVal b As Integer, ByVal c As Integer) As Integer Dim maxAB As Integer maxAB = Math.Max(a, b) Return Math.Max(maxAB, c) End Function

$n = 10*(1+10)/2;

x -=y;

In visual basic: Module Module1 Sub Main() Dim Inst As Integer For Inst = 0 To 100 Step 2 Console.WriteLine(Inst) Next End Sub End Module

The following is for F95 and later (due to the use of intrinsic SUM ): My assumptions: -Your numbers are integers -Your numbers are stored in an array -The numbers you are describing are 0-100 program findSum !I assumed integer, replace this with your data type integer, dimension(100) :: numbers integer :: sumOfNumbers !We populate an array with our numbers !Replace this with your numbers do i=1,(size(numbers)+1) numbers = i end do !We find the sum of those numbers sumOfNumbers = sum(numbers) !We write out the sum to prompt write(*,*) 'Sum is: ', sumOfNumbers end program findSum

dim a as integer

In the same way as you would write any integer.

First you will need to have some basic programming knowledge. You can use this to help make the program that is needed.

Write a function that implements an algorithm that checks to see if a particular integer is prime (returning a boolean). Write a program that uses that function on each number from 1 to 100, and if true, displays that number.

Dim intNumber As Integer

write a program

write a program to create password like **** in visual basic language

People also asked