Friday, 5 September 2014

Running Tests in Expert view

  • Program to find  no of odd digits  between any two numbers.

Dim N1,N2, n, odd_no
N1 = inputbox(" Enter the starting number")
N2 = inputbox(" Enter the ending number")
N1=cint(N1)
N2=cint(N2)
print(" The odd numbers between " & N1 &" and " & N2 & "are")
For n=N1 to N2
If (n mod 2)<>0 Then
    odd_no=odd_no & cstr(n) &  vbtab
    End If
Next
Print (odd_no)


 Result-

  • Program to find whether the given no. is an odd no. or even no.





Dim n
n=inputbox(" Enter the Number -")
n=cint(n)
If (n mod 2)=0 Then
     print( n & " is a even number")
     else
     print(n &" is odd number")
End If
Result-

  • Program to reverse a string
MyStr = inputbox("Enter the String:")
nCnt = Len(MyStr)

For i = 1 to nCnt

   RevStr = Mid(MyStr,i,1)&RevStr

Next

print ( RevStr)

 Result-







 





No comments:

Post a Comment