Cn Flashcards
(13 cards)
What are keywords in C?
Predefined words with specific meanings in C compilers that cannot be used as identifiers
Examples include auto, break, default, do, extern, float, long, register, struct, for.
What is an identifier in C?
Names given by the user to program elements like variables, functions, and arrays
Identifiers must follow specific naming rules.
What is the first rule for naming identifiers in C?
The first character must be an alphabet or an underscore.
What characters can be used in identifiers?
Only letters, digits, or underscores.
Can keywords be used as identifiers?
No, keywords cannot be used as identifiers.
What is the maximum length of identifiers in C?
Identifiers should not be greater than 31 characters.
Can identifiers contain whitespace?
No, identifiers must not contain whitespace.
What are the most common functions for input and output operations in C?
scanf and printf.
Which library includes the printf and scanf functions?
stdio.h.
What is the purpose of the printf function?
To display formatted output to the console.
What is the syntax of the printf function?
printf(“format string”, argument1, argument2, …);
What does the format string in printf specify?
How the output should be formatted.
What are the arguments in the printf function?
Variables or constants whose values are to be printed.