76 338
Assignments Done
Successfully Done
In May 2019

Answer to Question #16433 in C++ for arif hussain

Question #16433
Q#1 • Write a program to find the factorial of a number using structure
Expert's answer
using namespace std;

struct factorial{
long unsigned int num, fac;
} f;

factorial *F;

void main(){
F = &f;
cout<<"enter a positive integer: ";
F->fac = 1;
for (int i=2; i<=F->num; ++i) F->fac *= i;
cout<<F->num<<"! = "<<F->fac<<"\n";

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions