How To Find Factorial
Jun 23, 2010how to find factorial
View 1 Replieshow to find factorial
View 1 RepliesDevelop an application which reads two integers n1 and n2 from the user via two textboxes and displays in a label the sum of the factorial of the integers n1 and n2?
View 3 Repliescan you write an algorithm which can calculate 500 factorial.scientific symbol(mode) is unauthorized.Answer should be in String mode.
View 1 RepliesTrying to figure out how to calculate factorials via loops. Cant seem to figure out where to start when using loops.
View 9 RepliesNeed to take the number from a textbox and get the factorial
Public Class Form1
Private Sub btnCalculate_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCalculate.Click
[Code]....
Imports System.Numerics 'have to add reference Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
[Code]...
calculate the factorial of given number using recursion.input the number in textbox and show the
result in another textboxrajeev ranjan, on 29 March 2010 - 12:38 PM, said:calculate the factorial of
given number using recursion.input the number in textbox and show the result in another textbox.
This is a math calculation which is using factorial.
[Code]...
So I need to get a button to take the number that a user enters into a textbox, calculate the factorial from that number, and display it in another textbox. I can't seem to get this to come out right.
Here's some of the code I've been playing with.
Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalculate.Click
Function Factorial(ByVal txtFactorial As Decimal) As Decimal
If txtFactorial <= 1 Then
MessageBox.Show("Enter a number greater than 1")
Else
txtAnswer = Factorial(txtfactorial - 1)
End If
End Function
Now I have to just work out the code part. Can a function be under a button? I'm getting an error about that. I'm also getting an error about the txtAnswer=Factorial(txtfactorial-1) part of the code.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click.[code]the program enters a number and display its factorial, our program has error, eg. if your going to input 7, the result would be {num1}5040.we are having difficulty in its result... the required output should be 1*2*3*4*5*6*7=5040
View 1 RepliesCan someone explain to me what the difference is between a recursive function and a factorial function. I know that a factorial function returns the product of all the numbers from 1 to itself. But how does that differ from what a recursive function does
View 2 RepliesI am currently using the code below within a VB.Net application to find specific text in a Word document. The text is surrounded by symbols represented by the character codes in the .Text statement. The code below is working fine. The issue now is that sometimes the desired text within a document has been marked for deletion and appears as tracked change within the document. I would like to find only the desired text that has NOT been marked for deletion. Does anyone know of a way to determine if the found text is a deletion?
[Code]...
I have been trying to find the last filled column row in a sheet using this.
clast = xlapp.ActiveSheet.Cells.Find("*", SearchOrder:=XlSearchOrder.xlByColumns, SearchDirection:=XlSearchDirection.xlPrevious).Column
rlast = xlapp.ActiveSheet.Cells.Find("*", SearchOrder:=XlSearchOrder.xlByColumns, SearchDirection:=XlSearchDirection.xlPrevious).Row
I've got a form - CMCConsole It pops up a dialog form for adding a new case.If the matter number in a textbox on that dialog form matches an existing cases matter number I would like to find it in the binding source of the CMCConsole form
Private Function CheckMatter(ByVal MtrNum As String) As Boolean
Dim cfIndex As Integer = CMCConsole.caseBS.Find("MatterNumber", MtrNum)
Dim cfIndex2 As Integer = CMCConsole.casefileBS.Find("MatterNumber", MtrNum)
[code]....
But it appear the filter for the CASE we were just on that is set on the binding source is keeping the FIND from seeing other cases.
caseBS.Filter = "CaseId=" & e.Node.Tag.ToString
Do I have to clear the filter in order to find a matter number in some other case??
how to search xml file and display the result in list box.then export a xml file to excel in the search result
View 4 Replieshow can you create find & find next (using tooltip menu) create in vb.net for datagridview value.
View 1 RepliesI have a TypedDataTable called CamerasDT which has a composite Primary Key of GroupId and CameraId. I want to use TypedDataTable.Rows.Find(key as object) to return a specific row by GroupId and CameraId. I don't seem to be able to find a way to send primary key to the find function.
View 1 RepliesI have a rich text box with the following text in it:
word word
I am finding the endings of the word, that is, the string "rd". The following code finds the first occurance, but then fails to find the last occurance, and the variable "indexToText " changes to -1.After the first search, the debugger shows the startLocation at character position 4, so it is not past the second occurance but still will not find it.
indexToText = FrmMain.RichTextBoxPrintCtrl1.Find(searchValue, _
startLocation, eof, RichTextBoxFinds.None)
If I change the text to:
word word word
It then finds the first two occurrences and fails to find the last occurrence.No matter how many words I add, it always fails to find the last occurrence.
I am suppose to only Find the total of each column in the last row. Find the grand total in the last cell (the bottom right corner)Ok i have tried to do the grandtotal but i am not getting what she wants done I have also tried to reverse the arrays but that was wrong to. I am only suppose to add two line one line is find the total of each colums in the last row and to find the grandtotal.
Module Module1
Sub Main()
Dim sum(5, 4) As Integer
Dim row, col As Integer
[code]....
Windows Form I have a textbox when I enter DOB in the textbox the Age should appear respectively .[code]...
View 2 RepliesI've been trying to get the IPs (or computer names) of the computers in the same network as the computer running the program.
I got as far as getting all the IPs of the servers in the network wich ended up in a dead end since its all the computers that i need and not the servers only.
My goal is to get acces to files on all the other computers, i guess a shared folder would do the work and just access it as a regular folder, but for that i need the computer name (wich i can get through his IP)
Basicly, I need to find the ips of all computers in the same network wich is not what i get right now...
Dim localIP() As System.Net.IPAddress = System.Net.Dns.GetHostAddresses(System.Net.Dns.GetHostName)
Dim strLocalIP As String = localIP(0).ToString
[Code].....
Yes I Was wounder How Would I use System.Net.Sockets To Find my IP And Then In A Separate code How Would I Make an IP changer What Im I making?: Im Making A Program That Tells You Your IP..and then There Will Be an Option To Change It If anyone no's about Computers I Want to No Y when I made An IP Thing in VB6 (using Winsock) That It Shows Me a Different [URL]..
View 9 RepliesHow to find the value of Pi using VB or C? and i want to calculate the values until a millionth or more than that where in i can use the values of the obtained in another program. fir example in a encryption program.
View 8 RepliesI am trying find a string in below string. url...by using url... How can I get Team Discussion word from it?
View 5 RepliesHow would you work out the amount of ram that is in the computer
View 1 RepliesTo get the computer name I wrote something like below:[code]This code works on the server machine but on the client machine its not working.Is there any another way to find the computer name.
View 3 Repliesmy app cant see my access db after installation.i traced the location of the db on the computer after installation
C:\Users\Timosoft\AppData\Local\Apps\2.0\QY65PWX9.W3T\QECRQCWW.P3T\wwtb...exe_e6ecfcd40db94ae4_0001.0000_none_93fcea95705260c6\bin\Debug
didnt get it.am using below code in the program to locate the db.
'declare provider and location
strPath = Path.GetDirectoryName(Application.ExecutablePath) & "\bin\Debug"
dbProvider = "PROVIDER=Microsoft.ACE.OLEDB.12.0;"
dbSource = "Data Source=" & strPath & "\wwtbamDB.mdb;Persist Security Info=False;Jet OLEDB:Database Password=kkkkkkkvvf??"
I have a page with Ajax Tab controls, within one of the tabs is a webcontrol that as a Telerik RadGrid, with Edit forms pointing to another web control. That edit form also contains Ajax Tabs and on one of those tabs, there is an Ajax modal popup of yet another webcontrol.The initial webcontrol works fine when used on it's own page, but the edit form fails to appear when the control is used within the Ajax Tabs as desired. The script manager is throwing the following error:
Microsoft JScript runtime error: Sys.InvalidOperationException: Could not find UpdatePanel with ID 'xxx'. If it is being updated dynamically then it must be inside another UpdatePanel.
I'm trying to code a section for my website in VB but VB can't seem to find a button. Is there a way for the code to find it?
I know where it is. Loginview > Login > LoginTemplate. How do I get VB.NET to point to that location?
I'm working on a custom menu system in asp.net that populates a horizontal menu on the fly based on which menu item is selected from the website's main menu.[url]....
At the time I'd written that post, it did work, but my development environment has changed and now I'm getting an error saying that the XML file can't be found.[code]...