C icon indicating copy to clipboard operation
C copied to clipboard

Update primeinrange.c for range issue

Open Soyvor opened this issue 1 year ago • 0 comments

Changes made:

The num starts from 2, as 1 is not a prime number. Fixed the loop condition in the inner loop: i <= (num / 2) instead of i = (num / 2). Added a space after each prime number to improve readability. With these changes, the code should work as intended and print the prime numbers between 1 and 100.

Soyvor avatar Aug 14 '23 06:08 Soyvor