Skip to content

Conversation

@adityasheth2000
Copy link
Contributor

No description provided.

int flag=1;
for(int j=1;j<=n;j++)
{
// int flag=1;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this belongs here

int main()
{
int n;
scanf("%d",&n);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a prompt for the user to know what to enter (problem states 20)

break;
}
}
if(flag==1)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a style thing but comparison to 1 is something many people don't want to see.

if (flag) is equivalent. (You're asking "is it true, that this is true?" instead of "is this true?")

}
if(flag==1)
{
printf("%d",i);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing linebreak at the end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants