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

Section 2.7, Question 6 - "Which of the following are keywords in C?" #102

Open
ghost opened this issue May 29, 2022 · 0 comments
Open

Section 2.7, Question 6 - "Which of the following are keywords in C?" #102

ghost opened this issue May 29, 2022 · 0 comments

Comments

@ghost
Copy link

ghost commented May 29, 2022

If there are any errors in my answer, feel free to correct them below.

Apart from b) If, c) main and d) printf, the rest of the options are all keywords.
Explanation:

  1. If is not the same as if. Since C is a case-sensitive language, the latter which is a keyword, is not recognized to be the same as the former.
  2. try declaring a int variable called main with some value, and try printing it on the screen. It has been hard-coded to be called by the operating system while executing a C program.
  3. printf is a part of the standard input/output library stdio.h. You can create your own variable called printf, although you can no longer use the printf() function.

Source:

  1. Where is main stored & is main a keyword? I do know that main() is a method but I am asking about "main"
  2. Is printf a keyword?
@ghost ghost changed the title Section 2.7, Question 6 - main is a keyword in C Section 2.7, Question 6 - "Which of the following are keywords in C?" May 29, 2022
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

No branches or pull requests

0 participants