Thursday 13 November 2014

Using for loop to calculate and print product of add integers from 1 to 15.newplusplus panels

newplusplus odd integer







#include "stdafx.h"
#include <iostream>
using namespace std;

int main()
{
    int i,prod=1;

    for ( i = 1; i <=15; i+=2)
    {
       
            prod = i * prod;
    }
    cout << " product: " << prod <<endl;
system("pause");
    return 0;
}
-------------------------------------------------
output:



0 comments:

Post a Comment