Introducing Radical.sh

Forget Code launches a powerful code generator for building API's

do while Loop - Executing the statement atleast once before checking condition in C++

#include <iostream>
 using namespace std;
 int main()
 {
     int fact=1,i=1,n;
     cout << "Enter the number ";
    cin >> n;
     do
     {
         fact=fact*i;
         i++;
     } while (i<=n );
    cout << "factorial is: " << fact << std::endl;
     return 0;
 }