Welcome to Dream.In.Code
Become a C++ Expert!

Join 137,420 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,969 people online right now. Registration is fast and FREE... Join Now!




factorial of elements of array

 
Reply to this topicStart new topic

factorial of elements of array, factorial of 5 elements

SPS
19 Jan, 2008 - 08:56 AM
Post #1

New D.I.C Head
*

Joined: 18 Jan, 2008
Posts: 4

CODE

#include<iostream.h>
#include<conio.h>
void main()
{
int num[3],fact=1;
for(int i=0;i<3;i++)
{
cout<<"enter the value"<<(i+1);
cin>>num[i];
}

for(int j=0;j<3;j++)
{
for(int k=0;k<=j;k++)
{
fact*=k;
}

}

cout<<"the fact= "<<fact;
getch();
}

User is offlineProfile CardPM
+Quote Post

GWatt
RE: Factorial Of Elements Of Array
19 Jan, 2008 - 09:04 AM
Post #2

human inside
Group Icon

Joined: 1 Dec, 2005
Posts: 2,199



Thanked: 20 times
Dream Kudos: 450
My Contributions
Is this supposed to be a question?
User is online!Profile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 12/5/08 04:22AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month