I have presented an algorithm that calculates strongly iteratively in C++.
Problem:
-the code compiles and displays on the screen, but after entering the number it closes the console window and that's it;
-gives him a number for n! and end of display;
-I tried adding the library [#include ], but it didn't help to display the results;
- the factorial function in braces should have a good syntax because I rewrote it based on the book;
- preferably the algorithm should be built on the [for] loop;
-searching in google, I found little about it, so I started to write it myself, but it doesn't want to work, there is an error somewhere.
[Code for factorial iteratively in C++]
[code:1:119d82eecd]#include
#include
#include
using namespace std;
long silnia(int liczba )
{
long int silnia=1;
for(int i=2;i n;
cout
Problem:
-the code compiles and displays on the screen, but after entering the number it closes the console window and that's it;
-gives him a number for n! and end of display;
-I tried adding the library [#include ], but it didn't help to display the results;
- the factorial function in braces should have a good syntax because I rewrote it based on the book;
- preferably the algorithm should be built on the [for] loop;
-searching in google, I found little about it, so I started to write it myself, but it doesn't want to work, there is an error somewhere.
[Code for factorial iteratively in C++]
[code:1:119d82eecd]#include
#include
#include
using namespace std;
long silnia(int liczba )
{
long int silnia=1;
for(int i=2;i n;
cout