Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update add_2_integers.c #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

imkashyap888
Copy link
Contributor

Updated in simple form.

int main() {
int a, b, sum;

Copy link
Owner

Choose a reason for hiding this comment

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

Keep in mind, that this codebase is intended for readers looking to learn C, so some obvious redundant efforts are actually intentionally, this include the print line here to let the user observe the start of the program execution.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay purely understand that, many people have problems on many things. Thank you for your feedback, I appreciate that 🙏

// Get the first integer from the user
printf("Enter the first integer: ");
scanf("%d", &a);
Copy link
Owner

Choose a reason for hiding this comment

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

Personally, i would argue that beginners be introduce to naming variables as meaningful constructs, since this doesn't offer any technical improvement over the previous structure, it is not an update , so we can stick with the longer variable names, nice work though 👌

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay I understand that and thank you for your feedback.


// Display the result
printf("The sum of %d and %d is %d\n", a,b, sum);
Copy link
Owner

Choose a reason for hiding this comment

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

🔥🔥🔥🔥

Copy link
Owner

@brianobot brianobot left a comment

Choose a reason for hiding this comment

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

I have indicated in the codebase the changes needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants