That’s what I got, but it makes an infinite loop. Please help. I should use all the varaible types from short to unsigned long long, but I have problem with 2 already. If you can show me how to do at least 2 of them, that would be awesome.
{ printf("Enter a positive integer (or -ve integer to exit): "); scanf("%d",&num); while (num >= 0) { short f = 1; for(int i = num; i > 1; i-- ) { f = f * i; } printf("Factorial of %d is: %hi\n",num,f); } i= 1,f=1; while (num >= 0) { unsigned long long f = 1; for(int i = num; i > 1; i-- ) { f = f * i; } printf("Factorial of %d is: %hi\n",num,f); printf("Enter a positive integer (or -ve integer to exit): "); scanf("%d",&num); } printf("Thank you for using my software :)"); }