Logo/

Flashcard Deck

Log in

Made with ScholarlyMake flashcards like these from your own notes

Flashcard Deck

Questions and answers

92 cards
  1. Question:General form of a C program

    Answer:The structure and layout of a C program, including the use of headers, main function, and other key components.

  2. Question:Basic elements in a C program

    Answer:Includes data types, variables, assignment statements, input/output functions, and other fundamental building blocks in C programming.

  3. Question:Data types in C

    Answer:Categories or classifications of data such as integer, float, double, character, etc., which determine the type of values that can be stored and manipulated in a program.

  4. Question:Declaration of variables

    Answer:The process of specifying the data type and name of a variable in C, allowing it to be used to store and manipulate data in a program.

  5. Question:Assignment statements in C

    Answer:Statements that assign values to variables, allowing the manipulation and updating of data within a C program.

  6. Question:Reading data values in C

    Answer:The process of obtaining input data into a C program, often through functions like scanf(), to be used for computation and processing.

  7. Question:Displaying results in C

    Answer:The output or presentation of computed data or information from a C program to the user, often achieved through functions like printf().

  8. Question:Format strings for data entry and display

    Answer:Specifies the format for reading and displaying data in C, including the use of placeholders and formatting options with functions like scanf() and printf().

  9. Question:Software Development Method

    Answer:A structured approach to developing software, involving problem definition, analysis, algorithm design, coding, testing, and maintenance.

  10. Question:Problem Definition

    Answer:The initial phase where the problem to be solved by the software is clearly identified, along with its requirements and constraints.

  11. Question:Problem Analysis

    Answer:The process of examining and understanding the problem in detail, including its inputs, outputs, processing requirements, and other relevant factors.

  12. Question:Algorithm Design and Representation

    Answer:Creating a step-by-step plan or set of instructions for solving the problem, often represented using pseudocode or flowcharts.

  13. Question:Coding and Debugging

    Answer:The process of translating the algorithm into a programming language (coding) and identifying and fixing errors or issues (debugging).

  14. Question:Conversion of kilometers to miles

    Answer:Converting measurements in kilometers to equivalent values in miles, often involving multiplication by the conversion factor.

  15. Question:Conversion of miles to kilometers

    Answer:Converting measurements in miles to equivalent values in kilometers, often involving multiplication by the conversion factor.

  16. Question:Data requirements for conversion program

    Answer:Input data: distance in kilometers or miles Output: distance converted to miles or kilometers Relationship: 1 mile = 1.609 kilometers

  17. Question:Algorithm for converting miles to kilometers

    Answer:1. Get the distance in miles 2. Convert the distance to kilometers (distance in kilometers = 1.609 * distance in miles) 3. Display the distance in kilometers

  18. Question:High-level programming language

    Answer:Refers to a programming language that is closer to human language and easier to read and write, such as C, C++, Java, Python, etc.

  19. Question:Year of development of C programming language

    Answer:1972, developed by Dennis Ritchie

  20. Question:Implement the algorithm as a program using the C programming language

    Answer:Implementing the algorithm as a program using C involves translating the algorithm into C code according to the syntax rules of the language.

  21. Question:High-level programming language developed in 1972 by Dennis Ritchie at ATT Bell Laboratories

    Answer:C is a high-level programming language developed in 1972 by Dennis Ritchie at ATT Bell Laboratories. It was designed to write the UNIX operating system and was originally used primarily for systems programming.

  22. Question:Preprocessor

    Answer:The preprocessor is a system program that modifies a C program prior to its compilation. It processes the source code before it is passed to the compiler.

  23. Question:Preprocessor Directive

    Answer:A preprocessor directive is a command that gives instructions to the preprocessor. It begins with a number symbol as its first nonblank character and is used to include header files, define constant macros, and more.

  24. Question:Library

    Answer:In C programming, a library is a collection of useful functions and symbols that may be accessed by a program. It has a standard header file whose name ends with the symbols '.h'.

  25. Question:Function Body

    Answer:In C programming, the function body refers to the remaining lines of the program enclosed in curly brackets. It consists of declarations and executable statements.

  26. Question:Main Function

    Answer:Every C program has a main function, which marks the point where program execution begins. It is a mandatory part of a C program and contains the declarations and executable statements.

  27. Question:Define Directive

    Answer:The define directive notifies the C preprocessor to replace each occurrence of the identifier NAME by value. It is used to define constant macros, and C program statements cannot change the value associated with the NAME constant macro.

  28. Question:Include Directive

    Answer:The include directive causes the preprocessor to insert definitions from a standard header file into a program before compilation. It gives the program access to a library and tells the preprocessor where to find the meanings of standard identifiers used in the program.

  29. Question:Reserved Words

    Answer:Reserved words in C are words that have special meaning and cannot be used for other purposes. They are all specified in lowercase and comprise a complete list of words with special meaning in the C language.

  30. Question:Reserved Words

    Answer:A word that has special meaning in C and cannot be used for other purposes. All reserved words appear in lowercase. Here is a complete list specified by ANSI (American National Standards Institute).

  31. Question:Standard Identifiers

    Answer:A word that has special meaning, but one that can be redefined and used by a programmer for other purposes. Redefinition is not recommended because C will no longer be able to use it for its original purpose. Example: printf, scanf.

  32. Question:User-Defined Identifiers

    Answer:Identifiers chosen by a programmer to name memory cells that will hold data and program results. Example: KMSPERMILE, miles, kms, kMS, KMS.

  33. Question:Syntax Rules

    Answer:1. An identifier must consist only of letters, digits, and underscores. 2. An identifier cannot begin with a digit. It can begin with a letter or an underscore. However, it is discouraged to start an identifier with an underscore because it can conflict with system names. 3. A C reserved word cannot be used as an identifier. 4. C compiler is case sensitive; identifiers that are composed of the same characters and symbols but differ in their uppercase and lowercase letters are considered different identifiers. 5. There is no rule on the length of an identifier. However, the first 31 characters of identifiers are discriminated by the compiler. So, the first 31 letters of two identifiers in a program should be different.

  34. Question:Good Programming Practice (Identifier Names)

    Answer:1. Pick a meaningful name for user-defined identifiers so its use is easy to understand. 2. Choose identifiers long enough to convey meaning but avoid excessively long names because you are more likely to make a typing error in longer names. 3. Do not choose names that are similar, as confusion may arise.

  35. Question:Identifiers

    Answer:User-defined names used to represent variables, functions, and other elements in a program.

  36. Question:Best Practice for Identifiers

    Answer:1. Use identifiers that are easy to understand. 2. Choose names long enough to convey meaning but avoid excessively long names. 3. Avoid similar names. 4. Avoid choosing names that only differ in their uppercase and lowercase letters.

  37. Question:C Language

    Answer:A high-level programming language known for its efficiency and flexibility, commonly used in system programming, embedded systems, and complex applications.

  38. Question:Elements of C Language

    Answer:The building blocks of the C programming language, including data types, variables, operators, control structures, functions, and more.

  39. Question:Jennifer Joyce

    Answer:A fictional name used as an example of an identifier.

  40. Question:M Montemayor

    Answer:A fictional name used as an example of an identifier.

  41. Question:CCC101

    Answer:An example of an identifier, possibly representing a course code or variable name.

  42. Question:Lecture 03

    Answer:An example of an identifier, possibly representing a lecture number or variable name.

  43. Question:Valid Identifiers in C

    Answer:Jennifer, Joyce, M, Montemayor, CCC101, Lecture, 03, MAXENTRIES, variable2, xYZ123, XyZ123, thisisalongone

  44. Question:Invalid Identifiers in C

    Answer:1Letter, TWOFOUR, joes, double, part2, char, for, static, twitter, 4score, twos, CONSTTIME, helloworld, x2y1z0

  45. Question:Variable Declarations

    Answer:Variable: a name associated with a memory cell whose value can change as the program executes. Variable Declarations: statements that communicate to the compiler the names of variables in the program and the kind of information stored in each variable.

  46. Question:Variable Declaration Syntax

    Answer:Syntax: datatype variablelist Examples: int count, large double rate, time char middleinitial, char answer, int age

  47. Question:Data Types in C

    Answer:Data Type: a set of values and operations that can be performed on those values. Standard Data Types in C: pre-defined data types e.g. int, char, double

  48. Question:Integer Data Types in C

    Answer:Data Type: int used to represent integers in C. Not all integers can be represented due to the finite size of a memory cell.

  49. Question:Data Type: int

    Answer:Used to represent integers in C. Integers are positive and negative real numbers. Whole numbers are integers because of the finite size of a memory cell. Not all integers can be represented. ANSI C specifies that the range must include at least the values -32767 through 32767.

  50. Question:Data Type: double

    Answer:Used to represent real numbers in C. Real numbers have an integral part and a fractional part that are separated by a decimal point. Scientific notation can be used to represent real numbers (e.g. 1230000 = 123 x 10^5). C Scientific Notation: you can read E or e as 'times 10 to the power'.

  51. Question:Data Type: char

    Answer:Used to represent an individual character value: a letter, a digit, or a special symbol. Each value is enclosed in single quotes. Represented in the memory as an integer whose value is determined by the code used by the C compiler. (e.g. A, z, 2, 9)

  52. Question:ASCII

    Answer:American Standard Code for Information Interchange. Most common code used to specify the integer representing each character value.

  53. Question:Variable Data Types

    Answer:- Number of children at school: int - Letter grade on an exam: char - Average number of school days a student is absent each year: double - First letter of your last name: char - Number of cars passing through an intersection in an hour: int - Area of a circle in square inches: double

  54. Question:Assignment Statement

    Answer:An instruction that stores a

  55. Question:Absences per year

    Answer:If your last name is Montemayor, double the first letter of your last name (M) to get 'MM', then convert to a number by taking its position in the alphabet: M=13. So the answer is 13.

  56. Question:Number of cars passing through an intersection in an hour

    Answer:Integer value.

  57. Question:Area of a circle in square inches

    Answer:Double value.

  58. Question:Assignment Statement

    Answer:An instruction that stores a value or computational result in a variable. In C, the symbol '=' is the assignment operator and is read as 'becomes' or 'gets'. Example: sum = sum + item;

  59. Question:Variable expression

    Answer:Executable Statements. Follow after the declarations in a function. C statements used to write or code the algorithm and its refinements. C compiler translates these into executable machine language; the computer executes the machine language version of these statements when we run the program.

  60. Question:Valid and invalid constants in C

    Answer:Valid: 15E2 (double), 35 (int), 'h' (char), 37491 (double), 912 (double), 45e3 (double). Invalid: PQR (invalid), true (invalid), 4719 (invalid).

  61. Question:Program

    Answer:A set of instructions that tell a computer what to do.

  62. Question:Executable Statement

    Answer:A statement that is written as a program to be carried out by the computer.

  63. Question:Jennifer Joyce M Montemayor

    Answer:Seems to be a name. Please provide more context for a flashcard definition.

  64. Question:CCC101

    Answer:A course code, please provide more context for a flashcard definition.

  65. Question:Lecture 03

    Answer:A specific lecture in a course. Please provide more context for a flashcard definition.

  66. Question:Assignment Statement

    Answer:A single char variable nextletter is assigned the character value A by the assignment statement nextletter = 'A'.

  67. Question:Executable Statements

    Answer:Instructions in a program that can be executed, such as variable assignments, function calls, and IO operations.

  68. Question:IO Operations and Functions

    Answer:An alternative way of storing values or computational results into a variable, done by copying data from an input device into a variable.

  69. Question:Input Operation

    Answer:An instruction that copies data from an input device into memory.

  70. Question:Output Operation

    Answer:An instruction that displays information stored in memory.

  71. Question:IO Functions

    Answer:C functions that perform input and output operations. The most common functions are supplied as part of the C standard input/output library, to which we gain access through the preprocessor directive.

  72. Question:Function Call

    Answer:Activating a function, analogous to asking a friend to perform an urgent task. You tell them what to do, not how to do it, and wait for your friend to report back that the task is finished. It consists of the function name and function arguments.

  73. Question:Calling the printf Function

    Answer:The printf function is called with function arguments enclosed in round brackets following the function name. It provides information needed by the function to print the listed variables or expressions whose values are displayed. If the print list has several variables, the format string should contain the same number of placeholders.

  74. Question:Calling the printf Function Syntax

    Answer:printf(format string, print list)

  75. Question:Format String

    Answer:A sequence of characters enclosed in quotes which specifies the form of the output. It contains placeholders, which are symbols beginning with '%' in a format string that indicate where to display the output value. It also contains an abbreviation for the type of data it represents.

  76. Question:Formatting Numbers in Program Output

    Answer:The number of columns used to display a value is called field width. Digits are displayed right-justified.

  77. Question:Multiple Placeholders

    Answer:Format strings can have multiple placeholders. C matches variables with placeholders in left-to-right order.

  78. Question:Field width

    Answer:The value is called field width, digits are displayed right-justified. Formatting Values of Type int.

  79. Question:Multiple Placeholders

    Answer:Format strings can have multiple placeholders. C matches variables with placeholders in left-to-right order.

  80. Question:Calling the scanf Function

    Answer:Copies into memory data typed at the keyboard by the program user during program execution. Syntax: scanf("format string", input list). Example: scanf("%lf %d", &miles, &firstinitial); The format string is a quoted sequence of placeholders; one placeholder for each variable in the input list.

  81. Question:Executable Statements

    Answer:Must indicate both the total field width needed and the number of decimal places desired. Jennifer Joyce M Montemayor CCC101 Lecture 03 49

  82. Question:return Statement

    Answer:Syntax: return expression Example: return 0 transfers control from a function back to the activator (caller) of the function. The value of expression is returned as the result of the function execution. Jennifer Joyce M Montemayor CCC101 Lecture 03 50

  83. Question:Output Display

    Answer:Show the output displayed by the following program lines when the data entered are 5 and 7: printf("Enter two integers"); scanf("%d %d", &m, &n); m = 5; n = 3; printf("%d %d", m, n);

  84. Question:User Input

    Answer:Write a statement that asks the user to type three integers and another statement that stores the user responses into first, second, and third.

  85. Question:Circle Area Calculation

    Answer:Write a program that asks the user to enter the radius of a circle and then computes and displays the circle's area. Use the formula: Area = PI x Radius x Radius, where PI is the constant macro 3.14159.

  86. Question:Standard Data Types

    Answer:List 3 standard data types of C.

  87. Question:Data Display Statement

    Answer:The average pH of citrus fruits is 2.2, and this value has been stored in the variable avgcitruspH. Provide a statement to display this information in a readable way.

  88. Question:Algorithm for Integer Operations

    Answer:Write an algorithm that allows for the input of an integer value, doubles it, subtracts 10, and displays the result. Jennifer Joyce M Montemayor CCC101 Lecture 03 53: General Form of a C.

  89. Question:avgcitruspH

    Answer:Stored variable for average citrus pH.

  90. Question:Displaying avgcitruspH

    Answer:Write a statement to display the average citrus pH in a readable way: printf("The average citrus pH is %.2f", avgcitruspH);

  91. Question:Algorithm for integer manipulation

    Answer:1. Input an integer value 2. Double the input 3. Subtract 10 from the doubled value 4. Display the result

  92. Question:General Form of a C Program

    Answer:1. Preprocessor directives 2. Main function heading 3. Declarations 4. Executable statements