Question Bank (3 marks) · Q1
Q.Mention different sections appear in C programming.
Karnataka PUCTextbookShort· 3mImportance★★★★★est
3% · 5/154 Questions
✓ Free question
[!TLDR]
Every C program follows a standard layout of six sections, most of which are optional except main().
A source program is written in a logical order so that the compiler can process it correctly. The commonly used sections are:
- Documentation section - comments giving the program name, author and purpose; ignored by the compiler.
- Link / preprocessor section - #include directives that link header files (such as stdio.h) to the program.
- Definition section - #define directives that define symbolic constants and macros.
- Global declaration section - declaration of variables/functions used by more than one function.
- main() function section - the compulsory part; it has a declaration part (local variables) and an executable part (statements) enclosed in braces { }.
- Subprogram section - user-defined functions, written before or after main().
Only the main() function is compulsory; the remaining sections are included as required.
[!ANSWER]
Documentation, Link/preprocessor, Definition, Global declaration, main() function, and Subprogram sections - with only main() being compulsory.
Unlock everything free for 14 days
- Full step-by-step solutions
- Concept-first explanations
- Methods, shortcuts & mistakes
- PYQ mapping + timed mock tests
Full access for 14 days. No credit card required.