PRocesses: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 0 1 2 3 4 5 6 7 8 9
Dlls: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 0 1 2 3 4 5 6 7 8 9
Popular: svchost.exe | csrss.exe | rthdcpl.exe | spoolsv.exe | mrt.exe | lsass.exe | Home | Manufacturers


Optmizing functions

There is a section of the book I am using to learn c++ which teaches about optimizing functions.

The code is as follows:

#include <iostream>

using namespace std;

int computeFactorials(int, int);

int factorial(int);

int main() {
computeFactorials(1, 5);
return 0;

int computeFactorials(int num, int max) {
cout << 'Factorial of ' << num << ': ';
cout << factorial(num) << endl;
if(num > max)
return 0;
computeFactorials(num, max);

int factorial(int n) {
int result;
if (n == 1)
result = 1;
result = (factorial(n-1) * n);
return result;

Here is the program execution:

Factorial of 10: 3628800

C:MyProgramsc++ optimize.cpp -o optimize.exe

Factorial of 1: 1
Factorial of 2: 2
Factorial of 3: 6
Factorial of 4: 24
Factorial of 5: 120

I can follow up to num == 3, but when it gets to 4 my logic doesn't add up with the results. I am reading the code like this:

computeFactorials(1,5), 1 meaning the number to start at, and 5 meaning the maximum number of loops. I'm going to start at 3 per se because I understand 1 and 2 as num.

'Factorial of ' (3) : factorial(3), then in the factorial function 3 is subtracted by 1 equaling 2, and then multiplied by 3 for a result of 6.

However, when the program gets to num equaling 4 this doesn't seem to make any sense anymore. Because the int result of the factorials() functions should equal 12 not 24.

else result = (factorials (4-1) * 4) ;

3 * 4 = 12, not 24. How is this program getting to 24 and not 12? Then once again doing the same thing on num = 5, getting 120 rather than 20.

Please help me understand, I am still very nooby in this language, thank you. :)

View Complete Forum Thread with Replies

Related posts for optimize.exe

See Related Forum Messages: Follow the Links Below to View Complete Thread

Optmizing functions

optimize.exe: Optmizing functions

There is a section of the book I am using to learn c++ which teaches about optimizing functions.

The code is as follows:

#include <iostream>

using namespace std;

int computeFactorials(int, int);

int factorial(int);

int main() {
computeFactorials(1, 5);
return 0;

int computeFactorials(int num, int max) {
cout << 'Factorial of ' << num << ': ';
cout << factorial(num) << endl;

winword.exe: WinWord.exe won't close

I am running into issues creating a Word document Word from Excel using

Set wordapp = CreateObject('word.Application')
Set letter = wordapp.Documents.Add

On first run it works fine, on second run it hangs. I think the issue is if I close the document I created using the Close Button in Word, it won't close WinWord.Exe. I think it has to do with whether I saved the document or not. How can I get around this?

I uninstalled/deactivated all of my Add-ins (I heard that co

svchost.exe: ESET Firewall rules for svchost.exe and javaw.exe?

All firewall from ESET is good. You select the Interactive mode and you enjoy life. But here problem: custom rules are created only for specific executable files: firefox.exe, skype.exe, notepad++.exe. As a rule, one file is responsible for one application. More rare - several files are responsible for one application (Steam, for example). And with this firewall copes. But javaw.exe and svchost.exe can be responsible for several applications or services. How to create rules for specific services

taskmgr.exe: Access to different versions of taskmgr.exe for analysis

I'm looking to get hold of different versions of taskmgr.exe from different versions of Windows, in order to test a Task Manager addon I'm building. I've managed to get some basic additional functionality into the Win7 version, but I need access to other copies so I can test on those too.

I don't need a copy of the entire OS (otherwise I'd grab the compat VHDs from Microsoft), since my reverse engineering skills are good enough to write static patches without a debugger, so just the actua

iexplore.exe: Unhandled exception at 0x75619617 (KernelBase.dll) in iexplore.exe

I'm making a firebreath based plugin which adds two integers.
I'm debugging the plugin by attaching the source to the browser. I'm getting the above exception at this step of my PLUGINAPI.cpp
I have created and built the dll of the wrapper and the c# id libraries. it's working..added the project references of these to my firebreath api project.
In PLUGINAPI project>>

int PLUGINAPI::PerformAddition(int a, int b)
IWrapIt *wrapIt=IWrapIt::CreateInstance();

wmiprvse.exe: Want to script Windows WMI (wmiprvse.exe) to release handle on file

I'm working with a VB Script file written by someone else that uses Windows Management Instrumentation (WMI) calls to check on the status of several Windows Services. This script runs every few minutes on set schedule. I need to upgrade/replace the .exe for those services.

I stop the VB Script, stop the services, and uninstall the services so they no longer appear in the Services panel (services.msc). Unfortunately, WMI (wmiprvse.exe) still has a handle on the service .exe files. I ca

df.exe: Is there a better way to find the percent of one column that meets a criteria for each value…

I have a data frame with columns grade.equivalent and scaled.score, both numeric. I'd like to find the percent of students at or above a given scaled.score for all students at or above each grade.equivalent.

For example, given the following data frame:

df.ex <- data.frame(grade.equivalent=c(2.4,2.7,3.1,2.5,1.4,2.2,2.3,1.7,1.3,2.2),

I'd like to know for each grade.equivalent, what percent of students score

svchost.exe: System becomes very slow to figure out this want to know more about System32 Folder

What does the System32 Folder ? Why important ? What it does ? What are its roles and responsibilities ?
Why chrome process and svchost.exe process is using so much physical memory ?
What is svchost.exe process ? Is svchost.exe harmful ?

cli.exe: How to use PHP to call another CLI.exe process I/O in linux?

I have a CLI.exe developed by mono and want to control it by PHP.
My idea is let the CLI keep readline as its input, after this, we can get a PID of this CLI.
Next, Let PHP scripts send commands to this CLI as CLI's input via PID(or something else).
But I don't know if there's any PHP func can do this or how.
Any help is appreciate!

excel.exe: Killing EXCEL.exe Process from C# in a Windows Service

I have a windows service that opens up an Excel spreadsheet via the Microsoft.Office.Interop.Excel.Application object.

Application xlApp = new Application();
Workbook workbook = xlApp.Workbooks.Open(fileName, 2, false);

I would like to kill the EXCEL.exe process that is left running after it is done working with the workbook.

I've tried the following with no success...

// This returns a processId of 0

vsmon.exe: What is recommended for remotely debugging a .NET CLR Managed Application with a custom debu…

When you install and use the Microsoft Remote Debugging tool (vsmon.exe), you are directed to then use Visual Studio to attach to the remote debugging tool for actual debugging.

I cannot find:

Any details of the protocol used between the remote debugger and Visual Studio
Any source code for acting as the client to the remote debugger
Any dll for interacting with the remote debugger as a third party application

Is this not feasible? (Ie. My assessment above is

EUROBYTE TOOLS - cleans and speeds up your computer

You know it: the longer you own your computer, the slower it runs and the more often the stucks.
Can I change it?
Of course Yes.

Try EUROBYTE TOOLS, program, that cleans and speeds up thousands of computers around the world.
It's quick, automatic and effortless.
So easy to use that even a beginner can use it.

See this page in: English Espanol

This web site and all information written here is for information purposes only, WITHOUT ANY VARANTY. YOU ARE USING THIS PAGES ON YOU OWN RISK. You should always verify the accuracy of information provided on this page. We pay a big attention to provide you with the correct information. However, many spyware and malware programs use filenames of usual, non-malware processes and DLLs. If we have included information about optimize.exe that is inaccurate, we would appreciate your help by getting us know about your user review. Also, web links to software and DLL vendors are provided just for your conform, and we cannot guarantee its accuracy nor relevance with DLL or process listed on this page. We are not affiliated with this pages. We are not responsible for misprints on this site or changes occured since this page was published. The product, software and operating system names mentioned on this web site, can be copyrighted and registered trademarks of their owners.