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

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