Skip to content

value of 'i' should be less than or equal . #1

@sunilsk1

Description

@sunilsk1

for(int i=2;i<n/2;i++)

If we enter 4 then it will not work , So it should be :

for(int i=2;i<=n/2;i++)

One more condition at the top if the num ==1 then its not a prime.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions