Introduction to Programming Basics
47 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

In the C programming language, the smallest individual unit is known as a ______.

Token

C language has a total of ______ keywords.

32

A variable in C is used to store a ______.

value

An integer constant refers to a sequence of ______.

<p>digits</p> Signup and view all the answers

Real constants, also known as ______ constants, have fractional parts.

<p>floating point</p> Signup and view all the answers

A single character constant is enclosed within a pair of ______ quote marks.

<p>single</p> Signup and view all the answers

Constants are referred to as fixed values that do not ______ during the execution of a program.

<p>change</p> Signup and view all the answers

The program written in high level language is shorter than the program written in ______ language.

<p>low level</p> Signup and view all the answers

Every high level language has a standard ______ approved by international organizations.

<p>syntax</p> Signup and view all the answers

High level language instructions are like ______ language statements.

<p>English</p> Signup and view all the answers

To convert source code into machine code, we use either a ______ or an interpreter.

<p>compiler</p> Signup and view all the answers

Interpreters usually take less time to analyze the source code, while compilers usually take a ______ amount of time.

<p>large</p> Signup and view all the answers

The 'C' language was developed by ______ Ritchie in 1972.

<p>Dennis</p> Signup and view all the answers

'C' language is well suited for ______ programming.

<p>structured</p> Signup and view all the answers

There are only ______ keywords in 'C'.

<p>32</p> Signup and view all the answers

Any problem/program is represented in the form of text, it is called ______.

<p>Algorithm</p> Signup and view all the answers

Any problem/program is represented in the form of picture, it is called ______.

<p>Flowchart</p> Signup and view all the answers

The above symbol shows Start or End of the process in a ______.

<p>program</p> Signup and view all the answers

The symbol of flowchart that shows processing in a ______.

<p>program</p> Signup and view all the answers

Machine language consists of strings of binary numbers (0 and 1) and is the only one language the processor directly ______.

<p>understands</p> Signup and view all the answers

Programming languages can be categorized into ______ level languages.

<p>two</p> Signup and view all the answers

Low level language can be further categorized into Machine language (1GL) and ______ language (2GL).

<p>Assembly</p> Signup and view all the answers

High level languages include Procedural-Oriented language and Problem-______ language (4GL).

<p>Oriented</p> Signup and view all the answers

Assembly language is also known as ______ language because programmer requires detailed knowledge of hardware.

<p>low-level</p> Signup and view all the answers

The program is converted into machine code by an ______.

<p>assembler</p> Signup and view all the answers

High level languages are easier to learn because they use instructions similar to ______ language.

<p>human</p> Signup and view all the answers

Procedural programming languages determine the ______ and the order of those steps to produce a desired output.

<p>steps</p> Signup and view all the answers

Problem-Oriented languages allow users to specify what the output should be without describing all the details of how the ______ should be manipulated.

<p>data</p> Signup and view all the answers

Natural languages are still in a developing ______ where we can write statements resembling normal sentences.

<p>stage</p> Signup and view all the answers

The logic of programs written in high level languages is very simple and easy to ______.

<p>detect</p> Signup and view all the answers

Every high level language provides a large number of built-in functions or ______ functions that can be used during programming.

<p>library</p> Signup and view all the answers

In a 'C' program, the ability to extend the program itself is referred to as ______.

<p>modularity</p> Signup and view all the answers

To display 'Hello Computer', the function ______ is used.

<p>printf</p> Signup and view all the answers

The first line of the program usually contains the ______ for the main function.

<p>int main()</p> Signup and view all the answers

The command to clear the screen in a C program is [blank()].

<p>clrscr</p> Signup and view all the answers

The output of the program that displays the sum of two values is 'Sum : ______'.

<p>30</p> Signup and view all the answers

The section that consists of comment lines giving the name of the program, author, and other details is called the ______ section.

<p>Documentation</p> Signup and view all the answers

The section that provides instructions for the compiler to link functions from the system library is called the ______ section.

<p>Link</p> Signup and view all the answers

In the basic structure of C programs, the user-defined functions are listed after the ______ function section.

<p>main</p> Signup and view all the answers

A variable name must start with an alphabet or ______.

<p>underscore</p> Signup and view all the answers

A variable name in C can contain letters, digits, and ______.

<p>underscore</p> Signup and view all the answers

In C, an integer typically uses ______ bytes of memory.

<p>2</p> Signup and view all the answers

The double type in C uses ______ bytes for storage.

<p>8</p> Signup and view all the answers

A character type in C has a size of ______ byte.

<p>1</p> Signup and view all the answers

The void type in C indicates ______ value.

<p>no</p> Signup and view all the answers

The syntax for declaring a variable in C starts with the ______ type.

<p>data</p> Signup and view all the answers

To assign a value to a variable in C, the ______ operator is used.

<p>=</p> Signup and view all the answers

Flashcards

Algorithm

A step-by-step procedure for solving a problem, expressed in text.

Flowchart

A graphical representation of a problem-solving algorithm, using symbols.

Low-level language

A programming language close to the machine code. It's more difficult for humans to understand, but faster for computers to execute.

Machine language

The language understood directly by a computer's processor. It uses only 0s and 1s.

Signup and view all the flashcards

High-level language

A programming language that is easier for people to read and write than low-level languages.

Signup and view all the flashcards

1GL

Abbreviation for "First-generation language"; refers to machine language.

Signup and view all the flashcards

Start/End symbol (Flowchart)

The symbol used in flowcharting to mark the beginning and end of a process

Signup and view all the flashcards

Decision box (Flowchart)

A symbol representing a decision point in a program (e.g., if-then-else statements).

Signup and view all the flashcards

Interpreter

A program that translates and executes high-level language code one line at a time.

Signup and view all the flashcards

Compiler

A program that translates an entire high-level language program into machine code at once.

Signup and view all the flashcards

"C" language

A popular high-level programming language, known for its structure, and efficiency.

Signup and view all the flashcards

ANSI

American National Standards Institute; approved the "C" language in 1989.

Signup and view all the flashcards

Machine-independent language

A programming language that can be run on multiple types of computers without significant modification.

Signup and view all the flashcards

Keywords in "C"

Reserved words in the "C" programming language for specific purposes like declaring variables and controlling program flow.

Signup and view all the flashcards

Assembly Language (2GL)

A low-level programming language that uses symbolic codes (like 'ADD') instead of binary (0s and 1s) to represent instructions. Detailed hardware knowledge is needed by the programmer.

Signup and view all the flashcards

Procedural Language (3GL)

A type of high-level language that specifies the steps and order to get a desired output. Examples: Pascal, COBOL, C, FORTRAN.

Signup and view all the flashcards

Problem-Oriented Language (4GL)

A high-level language that allows users to specify what output they want without needing to describe how to get it. One step beyond procedural languages.

Signup and view all the flashcards

Natural Language (5GL)

An emerging type of high-level language that uses more human-like sentences. Often uses AI.

Signup and view all the flashcards

Assembler

A program that translates assembly language code into machine code.

Signup and view all the flashcards

C Program Structure

A C program is organized into sections like Documentation, Link, Definition, Global Declaration, main(), and User-Defined function sections.

Signup and view all the flashcards

Main Function

The main function is the entry point of a C program; execution begins here.

Signup and view all the flashcards

Declaration Part

Within the main function, this part declares variables used in the program's execution.

Signup and view all the flashcards

Executable Part

This part of a C program contains the statements that actually perform the tasks required.

Signup and view all the flashcards

User-Defined Functions

Functions that are written to perform specific tasks within a C program.

Signup and view all the flashcards

Link Section

Instructs the compiler to link functions from the system library.

Signup and view all the flashcards

Symbolic Constants

Predefined values given names in C programs.

Signup and view all the flashcards

Documentation Section

Comments explaining the code, author, and purpose of the program.

Signup and view all the flashcards

Tokens in C

The smallest individual units in a C program, like keywords, identifiers, constants, and operators.

Signup and view all the flashcards

Identifiers in C

User-defined names for variables, functions, and arrays. Must start with a letter or underscore and can contain letters, digits, and underscores.

Signup and view all the flashcards

Constants in C

Values that remain unchanged during program execution. They come in various types like integer and real.

Signup and view all the flashcards

Integer Constants

Numerical values without decimals. Examples: 10, 20, 30, 45

Signup and view all the flashcards

Real Constants

Numbers with decimal parts, often used for measurements, prices, and other fractional values.

Signup and view all the flashcards

Single Character Constant

A single character enclosed in single quotes, like 'A', 'B', 'c', or '5'.

Signup and view all the flashcards

String Constant

A sequence of characters enclosed in double quotes, like "Hello", "World", or "123".

Signup and view all the flashcards

Variable Naming Rules

Rules that govern how variables are named in programming. These rules ensure clarity and readability.

Signup and view all the flashcards

Data Type

A classification of data that determines the type of values a variable can hold, such as numbers, characters, or boolean values.

Signup and view all the flashcards

Integer Type

A data type representing whole numbers, including negative, zero, and positive values. It has a limited range defined by the computer's architecture.

Signup and view all the flashcards

Floating Point Type

A data type representing numbers with decimal values, providing greater accuracy than integer types.

Signup and view all the flashcards

Character Type

A data type for storing single characters, such as letters, numbers, or symbols.

Signup and view all the flashcards

Void Type

A special data type that represents the absence of a value, often used for function return types or to indicate that a function does not return a value.

Signup and view all the flashcards

Declaring a Variable

The process of informing the compiler about the name and data type of a variable before using it in a program.

Signup and view all the flashcards

Assigning Value to Variable

The action of storing a specific value into a variable using the assignment operator '='.

Signup and view all the flashcards

Study Notes

Introduction to Programming

  • Programming languages represent problems in text (algorithms) or picture form (flowcharts)
  • Flowcharts use symbols to depict program steps:
    • Start/End: Shows the beginning or end of a process
    • Process: Represents a processing step
    • Input/Output: Displays user input or program output
    • Decision Box: Illustrates decisions or choices
    • Flow Lines: Connects flowchart symbols to show the sequence of steps

Types of Programming Languages

  • Two main types: low-level and high-level
  • Low-Level Languages:
    • Machine language (1GL): Uses binary code (0s and 1s), understood directly by the computer's processor, fast execution, efficient primary memory use
    • Assembly language (2GL): Symbolic codes for machine instructions, requires hardware knowledge, translated into machine code using an assembler.
  • High-Level Languages:
    • Procedural (3GL): Specifies steps to achieve a desired outcome (e.g., Pascal, COBOL, C, FORTRAN)
    • Problem-oriented (4GL): Focuses on the desired output rather than the detailed steps (e.g., Visual Basic, C#, PHP)
    • Natural languages (5GL): Using human language-like statements, incorporates artificial intelligence (AI).

Characteristics of High-Level Languages

  • Easy to learn: Close to human languages, making them easier to learn and use.
  • Easier to detect and correct errors : Program logic is clear, thus error detection/correction is simpler.
  • Machine independence: Programs can run on different computer systems without modification.
  • Availability of Library functions: Offer ready-made functions to perform standard tasks, saving development time.

Overview of "C"

  • Popular, structured, high-level programming language, machine independent.
  • Developed by Dennis Ritchie in 1972.
  • ANSI (American National Standards Institute) and ISO (International Standards Organization) approved the language in 1989 and 1990, respectively.
  • "C" is robust, efficient, and fast.
  • Large number of built-in functions and operators.
  • 32 keywords.
  • Well-suited for structured programming.
    • Can extend programs.

C Tokens

  • Smallest individual unit of a program called a 'token'.
  • Includes keywords, constants, strings, and operators.
  • Keywords are reserved words with fixed meanings.
  • Identifiers are user-defined names for variables, functions, and arrays.
  • Constants represent fixed values that do not change during program execution.

Basic Structure of "C" Programs

  • Programs typically divided into sections:
  • Documentation Section (comments): provides program information.
  • Link Section: links program to libraries.
  • Definition Section: defines symbolic constants
  • Main function: contains declaration (variable definitions) and executable parts.
  • User-defined functions

Executing "C" Programs

  • Entering program into a "C" editor, saving.
  • Compiling (Alt+F9 key).
  • Checking for errors, and recompiling if needed.
  • Running the program (Ctrl+F9 key).

Character Set, Variables, and Data Types

  • Represents characters allowed in a "C" program for words, numbers and symbols.
  • Variables store values that can be changed during program execution.
    • First character must be an alphabet or underscore character.
    • Used only letters, numbers, and underscores.
    • Variable names of up to 31 characters are recognised.
    • Variable names cannot contain spaces.
  • Data Types specify the kind of data that variable will store.
  • "C" supports primary, derived, and user-defined data types.

Integer Type

  • Whole numbers (-2, -1, 0, 1, 2).
  • Uses 2 bytes.

Floating Point Type

  • Numbers with fractional parts, like decimals.
    • Single-precision (float): 4 bytes.
    • Double-precision (double): 8 bytes.
    • Long double: 10 bytes.

Integer Variables

  • Used to hold integer values.
    • Decimals (e.g., 5, -10, 0).
    • Octals (numbers starting with "0" digits 0-7).
    • Hexadecimals (numbers starting with "0x," digits 0-9,a-f).

Floating Point Variables

  • Used to hold floating-point values.

Character Type

  • Single characters (letters, symbols).
  • Uses 1 byte.
  • Enclose with single quotes.

Void Type

  • Represents the absence of an explicit value.

Declaration of Variable

  • Tells the compiler variable name.
  • Specifies the data type a variable holds.
  • Can be int, float, char etc.

Assigning Value to Variables

  • Use the assignment operator (=) to assign values to variables.

Defining Symbolic Constants

  • Constants stored using symbolic names for better readability and reuse in programs.

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

Description

This quiz covers the fundamentals of programming languages, including the representation of algorithms and flowcharts. You'll learn about the different types of programming languages such as low-level and high-level, and their characteristics. Test your knowledge on how these concepts apply in real-world programming scenarios.

More Like This

Computer Programming Fundamentals
18 questions
C Programming Fundamentals
29 questions
Programming Fundamentals: Chapter 1
12 questions
Use Quizgecko on...
Browser
Browser