Logo/

Flashcards on Basic Programming - Functions

Log in

Made with ScholarlyMake flashcards like these from your own notes

Flashcards on Basic Programming - Functions

Questions and answers

8 cards
  1. Question:What is the purpose of top-down design in programming?

    Answer:Top-down design is used to break a large, complex problem down into smaller, manageable tasks.

  2. Question:What are the advantages of using functions in programming?

    Answer:Functions keep the main program smaller, enhance code management, reduce repetition, and make the code easier to write, read, and debug.

  3. Question:What is the structure of a function in programming?

    Answer:The structure of a function includes the function name, return type, parameters, function body, and return result.

  4. Question:What are the two types of functions in C?

    Answer:The two types of functions in C are built-in functions and user-defined functions.

  5. Question:What are some of the standard libraries in C?

    Answer:Some of the standard libraries in C include stdio.h, math.h, string.h, and ctype.h.

  6. Question:What is the syntax for declaring a function in programming?

    Answer:The syntax for declaring a function in programming is "return_type function_name(parameter_list) {function_body}".

  7. Question:What are some best practices for defining a function in programming?

    Answer:Some best practices for defining a function in programming include choosing a meaningful function name, specifying inputs and outputs, and including a contract for the function.

  8. Question:What is an example of a simple function in programming?

    Answer:An example of a simple function in programming that returns nothing (void) could be defined as follows: "\#include void functionName(){...}"