76 309
Assignments Done
Successfully Done
In May 2019

Answer to Question #25206 in C# for Malik

Question #25206
Develop a serial program to calculate a factorial using a for loop. No recursion. Time it.

to be done in c language.
Expert's answer
#include <iostream>
using namespace std;
void main()
int enteredNumber;
long result = 1;
printf("%s","enter the number from 1 to 16\n");
/*entered number can not exceed 16,
otherwise the program will give the wrong result,
because the results size will exceed of the 8 bytes*/
if(enteredNumber > 16)
printf("%s","entered number can not exceed 16,otherwise the program will give the wrong result,because the results size will exceed of the 8 bytes\n");
for( int i = 1; i<=enteredNumber; i++ )
if(enteredNumber == 1)break;
result *= i;

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