Computer Science, asked by adi8079, 1 year ago

write a program to print all the factors of 20 with output

Answers

Answered by ahmadmahmood033
1

The Factors Program is Here Below,

#include <iostream>

using namespace std;

main()

{ int fac=1,num,i;

 

cout<<"Enter Any number";

cin>>num;

while(num>1)

{ fac=fac*num;

   

  num=num-1;

}

cout<<"the fac starting from 1 is "<<fac;

return 0;

}

Similar questions