What must match in pairs in a C program?
Braces ({ and }).
What is the purpose of the printf() function?
To output data to the screen.
1/425
p.20
Basic Structure of a C Program

What must match in pairs in a C program?

Braces ({ and }).

p.21
Formatted and Unformatted I/O Functions

What is the purpose of the printf() function?

To output data to the screen.

p.19
Formatted and Unformatted I/O Functions

What does the format specifier %o represent?

Octal Integer.

p.11
Variables and Constants in C

What are constants in C?

Fixed values that do not change during the execution of a program.

p.17
C Tokens and Data Types

What is the precision of a float type in C?

6 digits.

p.15
Variables and Constants in C

What characters can a C variable name consist of?

Letters, digits, and underscores, starting with a letter or underscore.

p.18
Variables and Constants in C

What is the significance of the order in which variables are defined in C?

The order can be important; using a variable before defining it will cause an error.

p.4
Flowchart Symbols and Guidelines

How many flow lines should come out of a process symbol?

Only one flow line.

p.26
Operators in C

What does the modulo division operator (%) do?

Produces the remainder of integer division.

p.13
C Tokens and Data Types

What is a real constant?

A number that consists of a fractional part, representing quantities that vary continuously.

p.23
Formatted and Unformatted I/O Functions

What does the printf function display in the first program?

It displays the initialized integer, float, and character values.

p.14
C Tokens and Data Types

What are backslash character constants used for?

They are special characters used in output functions.

p.30
Operators in C

What does the bitwise OR operator do?

It performs the logical OR of the bits in each position of a number in its binary form.

p.1
Algorithms and Flowcharts

What is an algorithm?

A method of representing the step-by-step logical procedure for solving a problem.

p.10
C Tokens and Data Types

What are identifiers in C?

User-defined names for variables, functions, and arrays.

p.29
Operators in C

What is the purpose of the conditional operator in C?

To construct conditional expressions in the form exp1 ? exp2 : exp3.

p.15
C Tokens and Data Types

What is the purpose of data types in C programming?

To inform the compiler about the type of value stored in a memory location and the amount of memory required.

p.29
Operators in C

How does the conditional operator work?

If exp1 is true, exp2 is evaluated; if false, exp3 is evaluated.

p.13
C Tokens and Data Types

What are examples of legal floating point constants?

0.65e4, 12e-2, 1.5e+5, 3.18E3, -1.2E-1.

p.20
Basic Structure of a C Program

Is C case-sensitive?

Yes, upper and lower case characters are different.

p.27
Operators in C

What is the meaning of the logical operator '!'?

Logical NOT.

p.9
C Tokens and Data Types

What is the ASCII value for the digit '0'?

48.

p.26
Operators in C

What is an operator in C?

A symbol that tells the computer to perform mathematical or logical manipulations.

p.5
Flowchart Symbols and Guidelines

How can the validity of a flowchart be tested?

By passing through it with simple test data.

p.24
Unformatted and Unformatted I/O Functions

What are unformatted I/O functions in C?

They are used for simple reading of data from the keyboard and writing to an I/O device without any format.

p.27
Operators in C

What does the operator '>' signify?

Greater than.

p.13
C Tokens and Data Types

What is the hexadecimal representation of the decimal number 11703?

2DB7.

p.18
Variables and Constants in C

What does the keyword 'const' do in C?

It declares a variable whose value must not be modified during program execution.

p.13
C Tokens and Data Types

Give examples of real constants.

0.0026, -0.97, 435.29, +487.0.

p.3
Flowchart Symbols and Guidelines

What is a potential issue with flowcharts regarding technical details?

The essentials of what is done can easily be lost in the technical details of how it is done.

p.13
C Tokens and Data Types

What is the general form of a real number in exponential notation?

mantissa * 10^exponent.

p.25
Formatted and Unformatted I/O Functions

What is the syntax for using putchar()?

putchar(character_variable/expr);

p.7
Introduction to C Language and History

What was a major limitation of the earlier programming languages like ALGOL60 and CPL?

They were either too general, too abstract, or too difficult to learn.

p.23
Formatted and Unformatted I/O Functions

What is the output format of the second program?

It displays the accepted integer, float, and character values in the order of reading.

p.15
Variables and Constants in C

Give examples of valid C variable names.

Alpha, X, fyear_9899, matrix, income.

p.18
Formatted and Unformatted I/O Functions

What is the format code for a single character?

%c.

p.30
Operators in C

What does the one's complement operator (~) do?

It inverts the bits of a given number, turning 1s into 0s and vice versa.

p.28
Operators in C

What are the advantages of using shorthand assignment operators?

1. Reduces repetition of the left-hand side. 2. Makes statements more concise and easier to read. 3. Increases efficiency.

p.20
Basic Structure of a C Program

What is the significance of the main function in a C program?

It is the starting and ending point of program execution.

p.28
Operators in C

What is the difference between pre and post increment/decrement operators?

PRE performs the operation first, followed by any assignment; POST performs the operation after any assignment.

p.20
Compilation and Execution of C Programs

What is the first step in writing and running a C program in Turbo C?

Creation of the Source Program.

p.19
Formatted and Unformatted I/O Functions

What does the format specifier %s represent?

String or sequence of characters.

p.5
Flowchart Symbols and Guidelines

What should be used to describe data or computational steps in a flowchart?

The annotation symbol.

p.5
Flowchart Symbols and Guidelines

What is essential for a flowchart to have?

A logical start and finish.

p.14
C Tokens and Data Types

What is a string constant in C?

A sequence of characters enclosed in double quotes.

p.16
C Tokens and Data Types

What are integers in C?

Whole numbers with a machine-dependent range of values.

p.8
Getting Started With C

What is the first step in learning the C language?

Knowing the character set, which includes alphabets, numbers, and special symbols.

p.6
Algorithms and Flowcharts

How are the steps of an algorithm represented in a flowchart?

In the form of shapes of boxes and logical flow with arrows.

p.8
Getting Started With C

How is learning C similar to learning English?

Both involve learning basic elements (alphabets or character set) and combining them to form more complex structures (words or instructions).

p.14
C Tokens and Data Types

What does any non-zero value represent in C?

True value.

p.9
C Tokens and Data Types

What types of symbols are included in the character set of C?

Alphabets (A-Z, a-z), digits (0-9), and special symbols (!@#~`%^&*(){}-+=_{}[]|\"'/<>:;).

p.18
Variables and Constants in C

What is the purpose of the 'volatile' qualifier in C?

It indicates that a variable's value may be changed by external sources, prompting the compiler to check its value each time.

p.12
C Tokens and Data Types

How is an octal integer constant indicated in C?

By starting with a 0.

p.17
C Tokens and Data Types

What are derived data types in C?

Secondary data types including arrays, structures, unions, and pointers.

p.29
Operators in C

How do increment and decrement statements commonly used in C?

They are extensively used in for and while loops.

p.4
Flowchart Symbols and Guidelines

How many flow lines are used in conjunction with a terminal symbol?

Only one flow line.

p.23
Formatted and Unformatted I/O Functions

How does the second program accept user input?

Using scanf for character, integer, and float values.

p.24
Unformatted and Unformatted I/O Functions

What is the function of putchar()?

It transmits a single character to a standard output device.

p.18
Formatted and Unformatted I/O Functions

What does the format code '%d' represent?

It represents a decimal integer.

p.9
C Tokens and Data Types

What is the ASCII value for the uppercase letter 'A'?

65.

p.1
Properties of Algorithms

What does 'Definite' mean regarding algorithm steps?

Each step must be precisely defined with no ambiguity or contradiction.

p.2
Algorithms and Flowcharts

What is the first step in finding the area and circumference of a rectangle?

Start.

p.24
Unformatted and Unformatted I/O Functions

What is the syntax for using getche()?

character_variable = getche();

p.10
C Tokens and Data Types

What are the smallest individual units in a C program called?

C Tokens.

p.6
Algorithms and Flowcharts

What is a flowchart?

A pictorial representation of an algorithm.

p.26
Operators in C

How are C operators classified?

1) Arithmetic Operators 2) Relational Operators 3) Logical Operators 4) Assignment Operator 5) Increment & Decrement Operator 6) Conditional Operator 7) Bitwise Operators 8) Special Operators.

p.5
Flowchart Symbols and Guidelines

What is an example of a flowchart task?

Finding the sum and average of two numbers.

p.16
C Tokens and Data Types

How many classes of integer storage does C have?

Three classes.

p.5
Flowchart Symbols and Guidelines

What is another example of a flowchart task?

Finding the largest of three numbers.

p.16
C Tokens and Data Types

What is the difference between signed and unsigned integers?

Signed integers can be positive or negative, while unsigned integers are always positive.

p.15
Variables and Constants in C

What should a C variable name not be?

A keyword.

p.21
Basic Structure of a C Program

What is the file extension for C source files?

.c

p.16
C Tokens and Data Types

What is the size of a short integer in C?

1 byte (8 bits).

p.10
C Tokens and Data Types

Why can't keywords be used as variable names?

Because it would assign a new meaning to the keyword.

p.25
Formatted and Unformatted I/O Functions

What is the output of the program when 'k', 'l', and ';' are entered?

First character is k, Second character is l, Third character is ;

p.7
Introduction to C Language and History

What is the significance of C's built-in functions and operators?

They can be used to write complex programs.

p.26
Operators in C

What are operands in the context of C operators?

Variables that operators act upon, such as 'a' and 'b' in the example.

p.6
Algorithms and Flowcharts

What is the purpose of Example 4 in the text?

To write pseudo code to check whether a student is passed or not.

p.27
Operators in C

What is the output of the expression '0 < 20'?

True (1).

p.24
Unformatted and Unformatted I/O Functions

What is the syntax for using getchar()?

character_variable = getchar();

p.23
Basic Structure of a C Program

What libraries are included in the C programs?

stdio.h and conio.h.

p.13
C Tokens and Data Types

What is a single character constant?

A single character enclosed within a pair of single quote marks.

p.20
Basic Structure of a C Program

Where should user-defined functions be placed in a C program?

Immediately after the main function.

p.18
Formatted and Unformatted I/O Functions

What does the format code '%h' represent?

It represents a short integer.

p.17
C Tokens and Data Types

What is the storage size of floating point numbers in C?

32 bits (4 bytes).

p.7
Introduction to C Language and History

Who developed the C programming language?

Dennis Ritchie.

p.14
C Tokens and Data Types

What values can a logical constant take in C?

Either true or false.

p.23
C Tokens and Data Types

What is the purpose of the first C program example?

To initialize int, char, and float data types.

p.15
Variables and Constants in C

Are variable names in C case sensitive?

Yes, uppercase and lowercase letters are treated differently.

p.23
C Tokens and Data Types

What are the initialized values in the first C program?

Integer: 78, Float: 3.0, Character: 'y'.

p.17
C Tokens and Data Types

What is the size of the void data type in C?

0 bytes.

p.11
C Tokens and Data Types

What characters are not permitted in decimal integers?

Spaces, commas, and non-digit characters.

p.22
Formatted and Unformatted I/O Functions

What is the syntax for scanf in C?

scanf("<format code>", list of address of variables separated by commas);

p.12
C Tokens and Data Types

What is the decimal equivalent of the octal number 3623?

1939 in decimal.

p.17
Variables and Constants in C

What is the syntax for declaring a variable in C?

data_type variable_name;

p.20
Basic Structure of a C Program

What are the two main parts of a C program?

Declaration and Execution Parts.

p.9
C Tokens and Data Types

What is the ASCII value for the space character?

32.

p.25
Formatted and Unformatted I/O Functions

What is the syntax for using putch()?

putch(character_variable/expr);

p.10
C Tokens and Data Types

Are uppercase and lowercase letters permitted in identifiers?

Yes, both are permitted, but lowercase is commonly used.

p.16
C Tokens and Data Types

How many bits are characters usually stored in?

8 bits (1 byte).

p.22
Formatted and Unformatted I/O Functions

What format specifier is used to read an integer in scanf?

%d.

p.13
C Tokens and Data Types

How is the character constant '5' different from the number 5?

'5' is a character constant, while 5 is a numeric constant.

p.28
Operators in C

What do increment (++) and decrement (--) operators do?

++ adds 1 to the operand, while -- subtracts 1.

p.30
Operators in C

What happens to the high-order bits during a right shift operation?

Zeros are placed in the n high-order bits of the variable.

p.30
Operators in C

What is the result of left-shifting the binary 00001100 by 3?

The result is 01100000 (decimal 96).

p.6
Algorithms and Flowcharts

What is an algorithm?

A step-by-step procedure for solving a problem.

p.3
Flowchart Symbols and Guidelines

What is one advantage of using flowcharts in programming?

Effective analysis: problems can be analyzed in a more effective way.

p.27
Operators in C

What are relational operators used for in C?

To test the relationship between two variables or between a variable and a constant.

p.10
C Tokens and Data Types

What are the six types of C tokens?

Keywords, Identifiers, Constants, Strings, Special Symbols, Operators.

p.25
Formatted and Unformatted I/O Functions

What does the putch() function do?

It prints any alphanumeric character taken by the standard input device.

p.9
C Tokens and Data Types

What is a character in C language?

Any symbol that denotes alphabets, digits, or special symbols used to represent information.

p.29
Operators in C

What does the prefix increment operator do in C?

It adds 1 to the operand first, then assigns the result to the variable on the left.

p.4
Flowchart Symbols and Guidelines

How many flow lines should enter a decision symbol?

Only one flow line.

p.2
Algorithms and Flowcharts

How is the area of a circle calculated?

By calculating the product of the radius with itself and the PI value.

p.29
Operators in C

What is the result of the statement y = m++; when m = 5?

y = 5 and m = 6.

p.15
Variables and Constants in C

What is the significance of the first 8 characters of a variable name in many compilers?

Only the first 8 characters are treated as significant.

p.18
Variables and Constants in C

What happens if you try to use a variable before it is defined?

It will result in an error, as the variable must be defined before it can be used.

p.11
C Tokens and Data Types

How is the binary number 1011 interpreted in decimal?

As 11 in decimal.

p.27
Operators in C

When is a logical expression true?

When all combined relational expressions are true.

p.14
Variables and Constants in C

What is a variable in C?

A quantity that may vary during program execution.

p.22
Formatted and Unformatted I/O Functions

How can multiple statements be displayed using printf?

By calling printf multiple times with different messages.

p.14
Variables and Constants in C

What is the purpose of a variable name in C?

To identify the memory location where the variable value is stored.

p.21
Compilation and Execution of C Programs

What happens if the '-o' option is not specified during compilation?

An executable file named 'a.out' is created.

p.7
Introduction to C Language and History

What earlier languages did C evolve from?

BCPL and B.

p.29
Operators in C

What are bitwise operators used for in C?

For manipulation of data at the bit level.

p.21
Compilation and Execution of C Programs

How do you execute a C program if the executable file name is specified?

./helloworld

p.19
Basic Structure of a C Program

What are global variables in a C program?

Variables that are used in more than one function, declared in the global declaration section.

p.28
Operators in C

How does the statement y = ++m; affect the values of y and m if m starts at 5?

Both y and m will be 6 after the statement executes.

p.19
Formatted and Unformatted I/O Functions

What is the format specifier for an unsigned long integer in C?

%lu.

p.8
Application Areas of C

What percentage of the UNIX operating system is written in C?

90%.

p.11
C Tokens and Data Types

What is an integer constant?

A sequence of digits representing fixed values.

p.3
Flowchart Symbols and Guidelines

How do flowcharts aid in program maintenance?

They make the maintenance of a program easier.

p.17
C Tokens and Data Types

What is the size and precision of a double type in C?

8 bytes (64 bits) with 14 digits of precision.

p.12
C Tokens and Data Types

What is the base of the octal number system?

Base Eight.

p.17
C Tokens and Data Types

What is the purpose of the long double type in C?

To extend precision further, using 80 bits.

p.12
C Tokens and Data Types

What digits are used in the octal number system?

0, 1, 2, 3, 4, 5, 6, and 7.

p.10
C Tokens and Data Types

How many keywords are available in C?

32 keywords.

p.27
Operators in C

What is the result of a relational expression if the relation is true?

One (1).

p.9
C Tokens and Data Types

What is the purpose of the character set in C?

To form the vocabulary of C, including constants, variables, and keywords.

p.26
Operators in C

What happens during integer division in C?

It truncates any fractional part.

p.24
Unformatted and Unformatted I/O Functions

What does getche() do?

It reads a single character without waiting for the enter key and echoes the character on the screen.

p.18
Formatted and Unformatted I/O Functions

What are format codes in C?

They are coding characters used to represent data types for formatted output.

p.11
Variables and Constants in C

What are the types of constants mentioned in C?

Numeric, integer, real, character, single character, string, and logical.

p.21
Compilation and Execution of C Programs

What command is used to compile a C program in UNIX/LINUX?

gcc helloworld.c -o helloworld

p.7
Introduction to C Language and History

What programming efficiency does C provide?

Relatively good machine efficiency and support for various data types.

p.29
Operators in C

What will be the value of x in the expression x = (a > b) ? a : b when a = 10 and b = 15?

x will be assigned the value of b (15).

p.9
C Tokens and Data Types

What is the ASCII value for the lowercase letter 'a'?

97.

p.1
Properties of Algorithms

What is meant by 'Effectiveness' in an algorithm?

Each step must be effective, easily converted into program statements, and performed in a finite amount of time.

p.29
Operators in C

Which data types can bitwise operators be applied to in C?

They may not be applied to float or double.

p.1
Properties of Algorithms

What is the significance of Input/Output in an algorithm?

Each algorithm must take zero, one, or more quantities as input data and produce one or more output values.

p.19
Formatted and Unformatted I/O Functions

What are the format specifiers for floating point values in C?

%e, %f, %g.

p.20
Compilation and Execution of C Programs

How can you view the output of an executed program in Turbo C?

Press Alt+F5.

p.4
Flowchart Symbols and Guidelines

What are the basic flowchart symbols?

1) Terminal block 2) Input/Output 3) Process block 4) Decision block 5) Flow lines.

p.25
Formatted and Unformatted I/O Functions

What is the purpose of the putchar() function?

It prints a single character to the standard output.

p.7
Introduction to C Language and History

In what years was C developed?

Between 1969 and 1973.

p.3
Flowchart Symbols and Guidelines

What role do flowcharts play in documentation?

Flowcharts serve as good program documentation.

p.10
C Tokens and Data Types

What are keywords in C?

Predefined words whose meanings are known to the C compiler.

p.3
Flowchart Symbols and Guidelines

What is a disadvantage of flowcharts related to complex logic?

Flowcharts can become complex and clumsy when the program logic is complicated.

p.24
Unformatted and Unformatted I/O Functions

What is the purpose of the getchar() function?

It reads a single character from the keyboard after the confirmation key is pressed.

p.4
Flowchart Symbols and Guidelines

How many flow lines should leave a decision symbol?

Two or three flow lines, one for each possible answer.

p.23
C Tokens and Data Types

What is the purpose of the second C program example?

To accept and display values of int, char, and float data types.

p.15
C Tokens and Data Types

What are the three broad classifications of data types in C?

Primary data types, derived data types, and user-defined data types.

p.21
Basic Structure of a C Program

What is the file extension for executable files created from C programs?

.exe

p.28
Operators in C

What is the purpose of the assignment operator (=) in C?

To assign the result of an expression to a variable.

p.2
Flowchart Symbols and Guidelines

What is the purpose of a flowchart?

To illustrate the sequence of operations to solve a problem.

p.28
Operators in C

What are shorthand assignment operators?

Operators of the form v op= exp, where v is a variable, exp is an expression, and op is a C arithmetic operator.

p.19
Basic Structure of a C Program

What is the purpose of the Documentation Section in a C program?

It consists of comment lines giving the name of the programmer, the name of the program, and other details.

p.15
Variables and Constants in C

Where are variables typically defined in a C program?

At the beginning of the block.

p.16
C Tokens and Data Types

What is the range of signed characters in C?

−128 to +127.

p.19
Basic Structure of a C Program

What is defined in the Definition Section of a C program?

All the symbolic constants.

p.29
Operators in C

What does the bitwise AND operator (&) do?

It performs a logical AND on the bits in each position of a number in its binary form.

p.30
Operators in C

What is the result of right-shifting the binary 00001100 by 2?

The result is 00000011 (decimal 3).

p.20
Compilation and Execution of C Programs

What key combination is used to execute a program in Turbo C?

Ctrl+F9.

p.8
Introduction to C Language and History

What capabilities does a C compiler combine?

The capabilities of an assembly language with features of high-level language.

p.15
Variables and Constants in C

What is the maximum length of a C variable name?

Up to 8 characters, with some translators allowing up to 32.

p.6
Algorithms and Flowcharts

In what language is an algorithm typically written?

In English-like language with words.

p.2
Algorithms and Flowcharts

What is the first step in finding the area, diameter, and circumference of a circle?

Start.

p.11
C Tokens and Data Types

What is a binary number?

A number made up of only 0s and 1s.

p.2
Algorithms and Flowcharts

What value is initialized to 0 in the circle area calculation?

PI.

p.22
Formatted and Unformatted I/O Functions

How do you print a message 'Hello World' in C?

Using printf("Hello World");

p.7
Introduction to C Language and History

What low-level features does C support?

Manipulation of bits and direct memory addressing using pointers.

p.21
Basic Structure of a C Program

What file extension is used for machine code generated from a C source file?

.obj

p.28
Operators in C

What is a logical expression?

An expression containing a logical operator that yields a value of one or zero.

p.22
Basic Structure of a C Program

What is the purpose of the clrscr() function in C?

To clear the screen before displaying output.

p.1
Properties of Algorithms

What are the properties of an algorithm?

Fitness, Definite, Effectiveness, Generality, Input/Output.

p.17
Variables and Constants in C

Can variables be initialized during declaration in C?

Yes, for example: int a = 10;

p.20
Basic Structure of a C Program

What must all C statements end with?

Semicolon (;).

p.2
Flowchart Symbols and Guidelines

What are the advantages of using flowcharts?

They make logic clear, facilitate communication, and guide coding during system analysis and program development.

p.28
Operators in C

Give an example of a shorthand assignment operator.

x += y + 1; is equivalent to x = x + (y + 1);

p.23
Basic Structure of a C Program

What function is used to clear the screen in the C programs?

clrscr().

p.22
Formatted and Unformatted I/O Functions

What is the significance of the '&' symbol in scanf?

It is used to provide the address of the variable where the input will be stored.

p.2
Algorithms and Flowcharts

What is stored in the variable 'temp' during the rectangle calculation?

The sum of length and breadth.

p.20
Basic Structure of a C Program

How can comments be added to a C program?

Comments can be added using /* comment */ syntax, but cannot be nested.

p.20
Compilation and Execution of C Programs

What key combination is used for compilation in Turbo C?

Alt+F9.

p.5
Flowchart Symbols and Guidelines

What should be avoided to enhance the effectiveness of a flowchart?

The intersection of flow lines.

p.10
C Tokens and Data Types

How many types of tokens are there in C?

Six types.

p.11
C Tokens and Data Types

What types of integer constants are supported in C?

Binary, decimal, octal, and hexadecimal.

p.24
Unformatted and Unformatted I/O Functions

What data type do unformatted I/O functions primarily work with?

Character data type.

p.27
Operators in C

What is the meaning of the operator '=='?

Equal to.

p.11
C Tokens and Data Types

What are valid examples of decimal integers?

123, -321, 0, 654321, +78.

p.26
Operators in C

Can the modulo division operator (%) be used on float and double datatypes?

No, it cannot be used on float and double datatypes.

p.28
Operators in C

What does the Logical NOT operator do?

It reverses the truth value of its operand (e.g., NOT F -> T).

p.8
Basic Structure of a C Program

What is the final goal of combining instructions in C?

To form functions or complete programs.

p.16
C Tokens and Data Types

What is the range of a signed short integer?

−128 to +127.

p.9
C Tokens and Data Types

What does ASCII stand for?

American Standard Code for Information Interchange.

p.3
Flowchart Symbols and Guidelines

What are flowchart symbols?

Different geometric shapes used in flowcharts.

p.10
C Tokens and Data Types

What characters can identifiers consist of?

Letters and digits, starting with a letter, and can include underscores.

p.16
C Tokens and Data Types

What is the range of an unsigned character?

0 to 255.

p.30
Operators in C

What is the result of the bitwise XOR operation between 00111110 and 00011001?

The result is 00110001.

p.12
C Tokens and Data Types

What do the letters A to F represent in hexadecimal?

Decimal values 10 to 15.

p.21
Compilation and Execution of C Programs

How do you execute a C program if the executable file name is not specified?

./a.out

p.30
Operators in C

What is the result of applying the one's complement operator to 00111111?

The result is 11000000.

p.9
C Tokens and Data Types

What is the ASCII value for the exclamation mark '!'?

33.

p.21
Formatted and Unformatted I/O Functions

What are the standard formatted I/O functions in C?

printf() and scanf().

p.5
Flowchart Symbols and Guidelines

What is recommended if a flowchart becomes complex?

Use connector symbols to reduce the number of flow lines.

p.17
C Tokens and Data Types

What keyword is used to define floating point numbers in C?

float.

p.4
Flowchart Symbols and Guidelines

What is a key guideline for creating a flowchart?

The flowchart should be clear, neat, and easy to follow.

p.12
C Tokens and Data Types

What is the binary representation of the decimal number 11?

1011 in binary (2).

p.22
Formatted and Unformatted I/O Functions

What is the purpose of the printf function in C?

To print formatted output to the screen.

p.14
C Tokens and Data Types

What does zero (0) represent in C?

False value.

p.22
Formatted and Unformatted I/O Functions

What does the scanf function do in C?

It accepts input from the user and stores it in variables.

p.6
Algorithms and Flowcharts

What does an algorithm explain?

How a certain process is followed or a problem is solved.

p.8
C Tokens and Data Types

What are the components of C language vocabulary?

Keywords, reserved words, and identifiers.

p.25
Formatted and Unformatted I/O Functions

What does the puts() function do?

It takes a string as an argument and writes it to the screen.

p.6
Algorithms and Flowcharts

What may a flowchart lack compared to an algorithm?

Detailed instructions about how the tasks are done.

p.2
Algorithms and Flowcharts

What is the formula to calculate the diameter of a circle?

Diameter = 2 * radius.

p.14
C Tokens and Data Types

What does the escape sequence '\n' represent?

New Line.

p.30
Operators in C

What is the result of the bitwise OR operation between 00111110 and 00011001?

The result is 00111101.

p.16
C Tokens and Data Types

What formula is used to find the range of signed data types?

−2^(n-1) to 2^(n-1) − 1.

p.13
C Tokens and Data Types

What does the exponent in exponential notation do?

It causes the decimal point to 'float'.

p.1
Properties of Algorithms

What does 'Fitness' mean in the context of algorithms?

An algorithm must terminate in a finite number of steps.

p.22
Basic Structure of a C Program

What is the output of the program that prints 'Hello World'?

'Hello World'.

p.14
Variables and Constants in C

How does a variable differ from a constant in C?

A variable can hold different values during execution, while a constant is restricted to one value.

p.19
Basic Structure of a C Program

What does the Link Section in a C program do?

It provides instructions to the compiler to link functions from the system library, e.g., '#include<stdio.h>'.

p.2
Algorithms and Flowcharts

How is the area of a rectangle calculated?

By calculating the product of length and breadth.

p.30
Operators in C

What do the shift operators (<< and >>) do in C?

They shift the bits in an integer variable by a specified number of positions to the left or right.

p.29
Operators in C

What is the result of the bitwise AND operation between 0011 and 1100?

The result is 0000.

p.19
Formatted and Unformatted I/O Functions

What does the format specifier %ld represent?

Long integer.

p.25
Formatted and Unformatted I/O Functions

What does the function getchar() do in C?

It reads a single character from the standard input.

p.8
Application Areas of C

What are some application areas of C?

System software, application software, device drivers, internet protocols, translators, print spoolers, and utilities.

p.4
Flowchart Symbols and Guidelines

What is the usual direction of flow in a flowchart?

From left to right or top to bottom.

p.26
Operators in C

What are the basic arithmetic operators in C?

+ (Addition), - (Subtraction), * (Multiplication), / (Division), % (Modulo Division).

p.7
Introduction to C Language and History

What is C considered in terms of programming language levels?

A middle level programming language.

p.25
Formatted and Unformatted I/O Functions

What is the purpose of the gets() function?

It reads a string of characters from the standard input.

p.7
Introduction to C Language and History

What are some high-level features supported by C?

Commands like if, else, goto.

p.3
Flowchart Symbols and Guidelines

What happens to flowcharts when alterations are required?

The flowchart may require re-drawing completely.

p.24
Unformatted and Unformatted I/O Functions

How does getch() differ from getchar()?

getch() reads a single character without waiting for the enter key and does not display the character on the screen.

p.27
Operators in C

What does the logical operator '&&' represent?

Logical AND.

p.6
Algorithms and Flowcharts

What is the purpose of Example 3 in the text?

To draw a flowchart to compute the final price of an item after figuring in sales tax.

p.2
Flowchart Symbols and Guidelines

What does a flowchart visually represent?

The flow of data through an information processing system and the sequence of operations.

p.12
C Tokens and Data Types

What is the base of the hexadecimal number system?

Base Sixteen.

p.30
Operators in C

What does the bitwise exclusive OR (XOR) operator do?

It adds the two bits discarding the carry, resulting in zero only when both bits are the same.

p.12
C Tokens and Data Types

How are hexadecimal integers indicated in C?

By prefixing with 0X or 0x.

p.27
Operators in C

What does the logical operator '||' signify?

Logical OR.

p.24
Unformatted and Unformatted I/O Functions

What is the syntax for using getch()?

character_variable = getch();

p.18
Formatted and Unformatted I/O Functions

What does the format code '%i' represent?

It represents a decimal, hexadecimal, or octal integer.

p.27
Operators in C

What is a compound relational expression?

An expression that combines two or more relational expressions.

p.21
Formatted and Unformatted I/O Functions

What are the two forms of I/O functions in C?

Formatted and Unformatted.

p.1
Algorithms and Flowcharts

What is the first step in the example algorithm to find the sum and average of two numbers?

Read the numbers a, b.

p.30
Operators in C

What are some special operators supported by C?

Comma operator, sizeof operator, pointer operators (& and *), and member selection operators (. and ->).

p.1
Properties of Algorithms

What does 'Generality' refer to in algorithms?

The algorithm must be complete and work successfully for all problems of a particular type.

p.9
C Tokens and Data Types

What is the ASCII value for the dollar sign '$'?

36.

p.1
Algorithms and Flowcharts

What is the last step in the example algorithm provided?

End of program.

p.19
Formatted and Unformatted I/O Functions

What does the format specifier %u represent?

Unsigned decimal integer.

p.13
C Tokens and Data Types

What is the significance of white spaces in exponential notation?

White spaces are not allowed.

p.19
Basic Structure of a C Program

What is the main function in a C program?

Every C program must have one 'main' function section, which contains a declaration part and an executable part.

p.21
Formatted and Unformatted I/O Functions

What is the syntax for using printf()?

printf("<message>"); or printf("<control string>", argument list);

p.19
Formatted and Unformatted I/O Functions

What does the format specifier %x represent?

Unsigned hexadecimal integer.

p.2
Algorithms and Flowcharts

What is the first step in finding the area, diameter, and circumference of a circle using the provided algorithm?
A) Read radius of the circle
B) Calculate the product of radius with itself
C) Start
D) Print the value of area
E) Stop

C) Start
Explanation: The first step in the algorithm is to 'Start', which initiates the process of calculating the area, diameter, and circumference of a circle.

p.11
C Tokens and Data Types

What are constants in C?
A) Values that can change during program execution
B) Fixed values that do not change during program execution
C) Variables that store data
D) Memory locations that can be altered
E) Temporary values used in calculations

B) Fixed values that do not change during program execution
Explanation: Constants in C refer to fixed values that remain unchanged during the execution of a program, making them essential for maintaining specific values throughout the program's lifecycle.

p.13
C Tokens and Data Types

What is the decimal equivalent of the hexadecimal number 2DB7?
A) 8192
B) 11703
C) 1024
D) 256
E) 4096

B) 11703
Explanation: The hexadecimal number 2DB7 is calculated as 2*16^3 + 13*16^2 + 11*16^1 + 7*16^0, which equals 11703.

p.19
Basic Structure of a C Program

Which part of the main function section contains the actual code that gets executed?
A) Documentation part
B) Declaration part
C) Executable part
D) Link part
E) Global Declaration part

C) Executable part
Explanation: The Executable part of the main function section contains the actual code that is executed when the program runs.

p.25
Input/Output Functions in C

What is the purpose of the putchar() function?
A) To read a string from input
B) To print a single character to the output
C) To accept multiple characters
D) To clear the console screen
E) To read a character from a file

B) To print a single character to the output
Explanation: The putchar() function is specifically designed to print a single character to the output, as shown in the example provided.

p.12
C Tokens and Data Types

What is the decimal equivalent of the binary number 1011?
A) 10
B) 11
C) 12
D) 13
E) 14

B) 11
Explanation: The binary number 1011 converts to decimal as follows: 1x8 + 0x4 + 1x2 + 1x1 = 8 + 0 + 2 + 1 = 11.

p.24
Input/Output Functions in C

What is the purpose of unformatted I/O functions in C?
A) To format data before input/output
B) To read and write data without any format
C) To convert data types
D) To perform mathematical operations
E) To display graphics

B) To read and write data without any format
Explanation: Unformatted I/O functions are designed for simple reading of data from the keyboard and writing to an I/O device without requiring any formatting, making them straightforward to use.

p.24
Input/Output Functions in C

Which of the following functions reads a single character from the keyboard?
A) printf()
B) scanf()
C) getchar()
D) puts()
E) gets()

C) getchar()
Explanation: The getchar() function is specifically used to read a single character from the keyboard after the confirmation key is pressed.

p.3
Flowchart Symbols and Guidelines

What is one advantage of using flowcharts in programming?
A) They make coding faster
B) They provide effective analysis of problems
C) They eliminate the need for documentation
D) They reduce the need for testing
E) They simplify the programming language

B) They provide effective analysis of problems
Explanation: Flowcharts allow for effective analysis of programming problems, helping to visualize and break down complex issues into manageable parts.

p.6
Algorithms and Flowcharts

What is the primary purpose of an algorithm?
A) To create a visual representation of data
B) To provide a step-by-step procedure for solving a problem
C) To write code in a programming language
D) To check the validity of a program
E) To store data in a database

B) To provide a step-by-step procedure for solving a problem
Explanation: An algorithm is defined as a step-by-step procedure for solving a problem, making it essential for programming and problem-solving tasks.

p.27
Operators in C

What is the purpose of relational operators in C?
A) To perform arithmetic calculations
B) To test the relationship between two variables or a variable and a constant
C) To manage memory allocation
D) To define functions
E) To handle input/output operations

B) To test the relationship between two variables or a variable and a constant
Explanation: Relational operators are specifically used to compare two quantities and determine their relationship, which is essential for decision-making in programming.

p.15
C Tokens and Data Types

What is the maximum length of a C variable name as per standard conventions?
A) 16 characters
B) 32 characters
C) 8 characters
D) 64 characters
E) 12 characters

C) 8 characters
Explanation: The standard length for a C variable name is up to 8 characters, although some translators may allow a higher length of up to 32 characters.

p.8
Introduction to C Language

What is a primary application area of the C programming language?
A) Web design
B) Game development
C) System software
D) Graphic design
E) Database management

C) System software
Explanation: C was initially used to design system software, with about 90% of the UNIX operating system written in C, highlighting its significance in system-level programming.

p.10
C Tokens and Data Types

What are the smallest individual units in a C program called?
A) Functions
B) C-Tokens
C) Variables
D) Operators
E) Statements

B) C-Tokens
Explanation: In a C program, the smallest individual units are known as C-Tokens, which are essential for writing programs using the syntax of the language.

p.27
Operators in C

Which logical operator is used to combine two conditions where both must be true?
A) ||
B) !
C) &&
D) ==
E) !=

C) &&
Explanation: The logical AND operator (&&) is used to combine two conditions, and the overall expression is true only if both conditions are true.

p.25
Input/Output Functions in C

What does the function getchar() do in C?
A) It prints a string
B) It reads a single character from standard input
C) It clears the screen
D) It writes a string to the output
E) It accepts multiple characters at once

B) It reads a single character from standard input
Explanation: The getchar() function is used to read a single character from the standard input device, which is demonstrated in the provided example.

p.11
C Tokens and Data Types

Which of the following is NOT a type of integer constant in C?
A) Binary
B) Decimal
C) Octal
D) Hexadecimal
E) Fractional

E) Fractional
Explanation: C supports binary, decimal, octal, and hexadecimal integer constants, but does not include fractional constants as a type of integer constant.

p.7
History

What year was the C programming language developed?
A) 1960
B) 1963
C) 1970
D) 1972
E) 1975

D) 1972
Explanation: The C programming language was developed in 1972, which is a pivotal year in the history of programming languages.

p.13
C Tokens and Data Types

Which of the following is NOT a valid real constant?
A) 215.
B) .95
C) -0.71
D) 3.14.15
E) +.5

D) 3.14.15
Explanation: The number 3.14.15 contains two decimal points, making it invalid as a real constant.

p.30
Operators in C

What is the result of the bitwise exclusive OR (XOR) operation?
A) It adds two bits with carry
B) It adds two bits without carry
C) It performs a logical AND
D) It performs a logical OR
E) It inverts the bits

B) It adds two bits without carry
Explanation: The bitwise exclusive OR (XOR) operation adds two bits together, discarding any carry, resulting in a zero only when both bits are the same.

p.10
C Tokens and Data Types

What is a characteristic of identifiers in C?
A) They can start with a digit
B) They must be all uppercase
C) They can include special characters
D) They must start with a letter
E) They cannot contain letters

D) They must start with a letter
Explanation: Identifiers in C must start with a letter (uppercase or lowercase) and can include digits and underscores, but cannot start with a digit.

p.15
C Tokens and Data Types

Which of the following is NOT a valid starting character for a C variable name?
A) A letter
B) A digit
C) An underscore (_)
D) A capital letter
E) A lowercase letter

B) A digit
Explanation: A C variable name must begin with a letter or an underscore; it cannot start with a digit.

p.4
Flowchart Symbols and Guidelines

Which of the following is NOT one of the basic flowchart symbols?
A) Terminal block
B) Input / Output
C) Process block
D) Loop block
E) Decision block

D) Loop block
Explanation: The basic flowchart symbols include Terminal block, Input/Output, Process block, and Decision block, but do not include a Loop block.

p.6
Flowchart Symbols and Guidelines

How is a flowchart primarily represented?
A) In a written report
B) As a series of numbers
C) As a pictorial representation with shapes and arrows
D) In a programming language
E) As a list of instructions

C) As a pictorial representation with shapes and arrows
Explanation: A flowchart visually represents an algorithm using shapes and arrows to indicate the flow of the process, making it easier to understand the sequence of steps.

p.8
Introduction to C Language

What is the first step in learning the C programming language?
A) Writing complex programs
B) Understanding syntax rules
C) Learning the character set
D) Combining functions
E) Developing applications

C) Learning the character set
Explanation: The first step in learning C is to understand the character set, which includes alphabets, numbers, and special symbols, similar to learning the alphabets in English.

p.11
C Tokens and Data Types

What is a valid example of a decimal integer constant?
A) 15 750
B) 20,000
C) -321
D) 2.5
E) $1000

C) -321
Explanation: -321 is a valid example of a decimal integer constant, as it consists of digits with an optional sign, while the other options either contain invalid characters or formats.

p.26
Operators in C

Which of the following is NOT a type of operator in C?
A) Arithmetic Operators
B) Relational Operators
C) Logical Operators
D) Graphical Operators
E) Assignment Operator

D) Graphical Operators
Explanation: C operators are classified into several categories, including arithmetic, relational, logical, assignment, increment & decrement, conditional, bitwise, and special operators. 'Graphical Operators' is not a recognized category.

p.6
Properties of Algorithms

Which of the following best describes the difference between an algorithm and a flowchart?
A) An algorithm is always more complex than a flowchart
B) An algorithm is written in a programming language, while a flowchart is not
C) An algorithm provides detailed instructions, while a flowchart may not
D) A flowchart is a step-by-step procedure, while an algorithm is a pictorial representation
E) There is no difference between an algorithm and a flowchart

C) An algorithm provides detailed instructions, while a flowchart may not
Explanation: An algorithm typically includes detailed instructions on how tasks are performed, whereas a flowchart may not provide such detailed steps, focusing instead on the overall process.

p.26
Arithmetic Expressions/Instructions

Which arithmetic operator is used for multiplication in C?
A) +
B) -
C) *
D) /
E) %

C) *
Explanation: In C, the asterisk (*) is the operator used for multiplication, distinguishing it from other arithmetic operations.

p.4
Flowchart Symbols and Guidelines

How many flow lines should come out of a process symbol in a flowchart?
A) None
B) One
C) Two
D) Three
E) Four

B) One
Explanation: According to flowcharting guidelines, only one flow line should come out of a process symbol, ensuring clarity in the flow of the procedure.

p.6
Algorithms and Flowcharts

What is an example of a task that could be represented in pseudo code?
A) Drawing a flowchart
B) Checking whether a student has passed or not
C) Writing a program in C
D) Creating a database
E) Designing a website

B) Checking whether a student has passed or not
Explanation: Writing pseudo code to check whether a student has passed is a common example of how algorithms can be expressed in a simplified, human-readable format before actual coding.

p.19
Input/Output Functions in C

What does the '%f' format specifier represent in C?
A) Long integer
B) Floating point value
C) Unsigned long int
D) Octal Integer
E) String or sequence of characters

B) Floating point value
Explanation: The '%f' format specifier is used in C to represent floating point values, which are numbers that have a decimal point.

p.19
Basic Structure of a C Program

What is the purpose of the Documentation Section in a C program?
A) To declare global variables
B) To define symbolic constants
C) To provide comments about the program
D) To execute the main function
E) To link system libraries

C) To provide comments about the program
Explanation: The Documentation Section consists of comment lines that give details such as the programmer's name and program details, helping in understanding the code later.

p.2
Algorithms and Flowcharts

In the circle example, what variable stores the area of the circle?
A) radius
B) diameter
C) circumference
D) temp
E) area

E) area
Explanation: The variable 'area' is specifically designated to store the result of the area calculation in the algorithm for finding the area, diameter, and circumference of a circle.

p.26
Operators in C

What is the primary function of an operator in C?
A) To store data
B) To perform mathematical or logical manipulations
C) To display output
D) To define variables
E) To manage memory

B) To perform mathematical or logical manipulations
Explanation: An operator in C is a symbol that instructs the computer to perform specific mathematical or logical operations, making it essential for data manipulation in programming.

p.2
Flowchart Symbols and Guidelines

What does a flowchart represent?
A) A programming language
B) A sequence of operations to solve a problem
C) A type of data structure
D) A debugging tool
E) A database schema

B) A sequence of operations to solve a problem
Explanation: A flowchart is a diagrammatic representation that illustrates the sequence of operations to be performed to solve a problem, making it easier to visualize the logic of a program.

p.23
C Tokens and Data Types

What is the output of the program that initializes int, char, and float data types?
A) Integer=20, Float Value=3.0, Character=a
B) Integer=78, Float Value=3.0, Character=y
C) Integer=78, Float Value=3.5, Character=z
D) Integer=0, Float Value=0.0, Character=
E) Integer=78, Float Value=0.0, Character=y

B) Integer=78, Float Value=3.0, Character=y
Explanation: The program initializes the variables with specific values and prints them, resulting in the output showing Integer=78, Float Value=3.0, and Character=y.

p.27
Operators in C

What is the result of the relational expression 10 < 20?
A) 0
B) 1
C) True
D) False
E) Undefined

B) 1
Explanation: The expression 10 < 20 evaluates to true, which is represented by 1 in C, indicating that the relation is valid.

p.3
Flowchart Symbols and Guidelines

How do flowcharts aid in program maintenance?
A) By making the code more complex
B) By providing a visual representation that simplifies maintenance
C) By eliminating the need for comments
D) By increasing the number of errors
E) By making the program run faster

B) By providing a visual representation that simplifies maintenance
Explanation: Flowcharts facilitate efficient program maintenance by offering a clear visual representation of the program's structure, making it easier to understand and modify.

p.19
Basic Structure of a C Program

What is the role of the Global Declaration Section in a C program?
A) To define the main function
B) To declare variables used in multiple functions
C) To provide documentation
D) To link libraries
E) To execute the program

B) To declare variables used in multiple functions
Explanation: The Global Declaration Section is where global variables, which are used across multiple functions, are declared.

p.8
Introduction to C Language

Which of the following is NOT an application area of C?
A) Writing device drivers
B) Developing translators
C) Designing application software
D) Creating mobile apps
E) Implementing INTERNET protocols

D) Creating mobile apps
Explanation: While C is used in various areas such as device drivers and INTERNET protocols, creating mobile apps is not typically associated with C, as other languages are more commonly used for that purpose.

p.27
Operators in C

What will be the result of the logical expression 'a > b && x == 10' if 'a' is 5, 'b' is 3, and 'x' is 10?
A) True
B) False
C) Undefined
D) 0
E) 1

A) True
Explanation: Since 'a' (5) is greater than 'b' (3) and 'x' (10) is equal to 10, both conditions are true, making the entire logical expression true.

p.4
Flowchart Symbols and Guidelines

What is a key guideline for creating a flowchart?
A) Use multiple colors for each symbol
B) The flowchart should be clear, neat, and easy to follow
C) Include as many symbols as possible
D) Use complex language in descriptions
E) Flow lines can cross each other freely

B) The flowchart should be clear, neat, and easy to follow
Explanation: A fundamental guideline in flowcharting is that the flowchart must be clear, neat, and easy to follow, ensuring there is no ambiguity in understanding.

p.5
Flowchart Symbols and Guidelines

What is the purpose of using annotation symbols in a flowchart?
A) To add colors
B) To describe data or computational steps more clearly
C) To connect different shapes
D) To indicate the end of the flowchart
E) To represent decisions

B) To describe data or computational steps more clearly
Explanation: Annotation symbols are used in flowcharts to provide additional descriptions, making the data or computational steps clearer for better understanding.

p.19
Basic Structure of a C Program

Which section of a C program provides instructions to link functions from the system library?
A) Documentation Section
B) Link Section
C) Definition Section
D) Global Declaration Section
E) Sub program section

B) Link Section
Explanation: The Link Section contains instructions like '#include<stdio.h>' that tell the compiler to link necessary functions from the system library.

p.7
Introduction to C Language

Who developed the C programming language?
A) Ken Thompson
B) Martin Richard
C) Dennis Ritchie
D) Bjarne Stroustrup
E) James Gosling

C) Dennis Ritchie
Explanation: C was initially developed by Dennis Ritchie between 1969 and 1973 at Bell Labs, marking a significant contribution to programming languages.

p.9
C Tokens and Data Types

Which of the following is NOT a part of the character set in C?
A) A
B) 1
C) @
D) #
E) π

E) π
Explanation: The character set in C includes alphabets, digits, and special symbols, but does not include non-ASCII characters like π, which is not part of the standard character set.

p.1
Properties of Algorithms

Which of the following is NOT a property of an algorithm?
A) Fitness
B) Ambiguity
C) Effectiveness
D) Generality
E) Input/Output

B) Ambiguity
Explanation: An algorithm must be definite, meaning each step should be precisely defined without ambiguity or contradiction. Ambiguity is not a property of a well-defined algorithm.

p.8
Introduction to C Language

In the analogy between learning English and learning C, what corresponds to 'sentences' in C?
A) Alphabets
B) Keywords
C) Instructions
D) Functions
E) Programs

C) Instructions
Explanation: In the analogy, 'sentences' in English correspond to 'instructions' in C, as both are formed by combining smaller elements (alphabets/keywords) to convey meaning.

p.29
Operators in C

What is the result of the statement 'y = m++;' if m is initially 5?
A) y = 6, m = 5
B) y = 5, m = 6
C) y = 5, m = 5
D) y = 6, m = 6
E) y = 0, m = 6

B) y = 5, m = 6
Explanation: The postfix operator 'm++' first assigns the current value of m (which is 5) to y, and then increments m to 6.

p.4
Flowchart Symbols and Guidelines

What is the correct number of flow lines that should enter and leave a decision symbol?
A) One enters, two or three leave
B) Two enter, one leaves
C) One enters, one leaves
D) Three enter, two leave
E) No flow lines should enter or leave

A) One enters, two or three leave
Explanation: A decision symbol in a flowchart should have only one flow line entering it, but it can have two or three flow lines leaving it, corresponding to each possible answer.

p.5
Flowchart Symbols and Guidelines

What is a key requirement for a flowchart?
A) It must have a colorful design
B) It should have a logical start and finish
C) It can be drawn in any shape
D) It should be as complex as possible
E) It must include at least ten steps

B) It should have a logical start and finish
Explanation: A flowchart must have a logical start and finish to ensure that the process it represents is clear and understandable.

p.7
Introduction to C Language

What is a key characteristic of the C programming language?
A) It is only for scientific computing
B) It is a low-level programming language
C) It is a general-purpose programming language
D) It is only used for web development
E) It is a purely functional programming language

C) It is a general-purpose programming language
Explanation: C is recognized as a general-purpose programming language, making it versatile for various types of programming tasks.

p.9
C Tokens and Data Types

What is the ASCII value of the uppercase letter 'A'?
A) 65
B) 97
C) 32
D) 90
E) 48

A) 65
Explanation: In the ASCII table, the uppercase letter 'A' is represented by the value 65, which is crucial for understanding character encoding in C.

p.1
Properties of Algorithms

What does 'effectiveness' in an algorithm refer to?
A) The algorithm must be easy to understand
B) Each step must be easily converted into program statements and performed in a finite amount of time
C) The algorithm must be visually appealing
D) The algorithm must be written in a specific programming language
E) The algorithm must be lengthy

B) Each step must be easily converted into program statements and performed in a finite amount of time
Explanation: Effectiveness ensures that each step of the algorithm can be executed in a finite amount of time and can be translated into programming code.

p.10
C Tokens and Data Types

Which of the following is NOT a type of C-Token?
A) Keywords
B) Identifiers
C) Constants
D) Functions
E) Special Symbols

D) Functions
Explanation: Functions are not classified as C-Tokens. The types of C-Tokens include keywords, identifiers, constants, strings, and special symbols.

p.5
Flowchart Symbols and Guidelines

What should be done if a flowchart becomes complex?
A) Remove all symbols
B) Use connector symbols to reduce the number of flow lines
C) Increase the size of the flowchart
D) Add more details
E) Use only one flow line

B) Use connector symbols to reduce the number of flow lines
Explanation: When a flowchart becomes complex, using connector symbols helps to simplify it by reducing the number of flow lines, making it easier to read and understand.

p.13
C Tokens and Data Types

What does the 'e' in exponential notation represent?
A) The base of the number
B) The exponent to multiply by 10
C) The decimal point
D) The whole number part
E) The fractional part

B) The exponent to multiply by 10
Explanation: In exponential notation, 'e' indicates the exponent, meaning to multiply the preceding number by 10 raised to that exponent.

p.6
Flowchart Symbols and Guidelines

What is a key feature of flowcharts?
A) They are written in English-like language
B) They can only represent simple algorithms
C) They use shapes and arrows to show logical flow
D) They are always more detailed than algorithms
E) They cannot represent decision-making processes

C) They use shapes and arrows to show logical flow
Explanation: Flowcharts utilize shapes and arrows to visually depict the logical flow of a process, making them effective for illustrating algorithms.

p.26
Arithmetic Expressions/Instructions

What happens when you use the modulo division operator on float or double data types in C?
A) It returns an integer
B) It produces an error
C) It truncates the decimal
D) It returns the float value
E) It converts to integer automatically

B) It produces an error
Explanation: The modulo division operator (%) cannot be used on float and double data types in C, leading to a compilation error if attempted.

p.12
C Tokens and Data Types

How do you convert the octal number 3623 to decimal?
A) 1536 + 384 + 16 + 3
B) 256 + 64 + 8 + 3
C) 512 + 128 + 32 + 3
D) 1024 + 256 + 64 + 3
E) 128 + 32 + 4 + 3

A) 1536 + 384 + 16 + 3
Explanation: To convert 3623 from octal to decimal, calculate 3x8^3 + 6x8^2 + 2x8^1 + 3x8^0 = 1536 + 384 + 16 + 3 = 1939.

p.27
Operators in C

Which of the following is NOT a relational operator in C?
A) >
B) >=
C) ==
D) &&
E) !=

D) &&
Explanation: The operator '&&' is a logical operator, not a relational operator. Relational operators include >, >=, <, <=, ==, and !=.

p.9
C Tokens and Data Types

What is a character in the C programming language?
A) A number only
B) Any symbol including alphabets, digits, and special symbols
C) Only uppercase letters
D) Only lowercase letters
E) Only digits

B) Any symbol including alphabets, digits, and special symbols
Explanation: In C, a character can represent any alphabet (A-Z, a-z), digit (0-9), or special symbol, which is essential for forming the vocabulary of C such as constants, variables, and keywords.

p.30
Operators in C

What does the bitwise OR operator do?
A) It adds two numbers
B) It performs a logical OR on the bits
C) It shifts bits to the left
D) It inverts the bits
E) It performs a logical AND on the bits

B) It performs a logical OR on the bits
Explanation: The bitwise OR operator performs a logical OR operation on each corresponding bit of two numbers in their binary form, resulting in a new binary number.

p.23
Input/Output Functions in C

What does the function 'clrscr()' do in the provided C programs?
A) Clears the console screen
B) Initializes variables
C) Displays the output
D) Accepts user input
E) Terminates the program

A) Clears the console screen
Explanation: The function 'clrscr()' is used to clear the console screen before displaying any output, providing a clean interface for the user.

p.11
C Tokens and Data Types

How is a binary number represented in C?
A) Using digits 0-9
B) Using only 0s and 1s
C) Using letters A-F
D) Using decimal points
E) Using special characters

B) Using only 0s and 1s
Explanation: A binary number in C is represented using only the digits 0 and 1, which is fundamental to binary numeral systems.

p.23
Input/Output Functions in C

In the program that accepts values from the user, which function is used to read an integer value?
A) printf
B) scanf
C) clrscr
D) getch
E) input

B) scanf
Explanation: The 'scanf' function is used to read input values from the user, including the integer value in this case.

p.10
C Tokens and Data Types

Why can't keywords be used as variable names in C?
A) They are too long
B) They are predefined words with specific meanings
C) They are reserved for future use
D) They can only be used in functions
E) They are not recognized by the compiler

B) They are predefined words with specific meanings
Explanation: Keywords in C are predefined words that have specific meanings to the compiler, and using them as variable names would assign a new meaning, which is not allowed.

p.24
Input/Output Functions in C

What does the putchar() function do?
A) Reads a single character from the keyboard
B) Transmits a single character to a standard output device
C) Formats output data
D) Returns a string of characters
E) Reads multiple characters at once

B) Transmits a single character to a standard output device
Explanation: The putchar() function is used to send a single character to the standard output device, typically the screen.

p.1
Algorithms and Flowcharts

What is an algorithm?
A) A programming language
B) A method of representing a step-by-step logical procedure for solving a problem
C) A type of computer hardware
D) A database management system
E) A graphical representation of data

B) A method of representing a step-by-step logical procedure for solving a problem
Explanation: An algorithm is defined as a method for representing the logical steps needed to solve a problem, making it a fundamental concept in programming.

p.3
Flowchart Symbols and Guidelines

What is a disadvantage of using flowcharts?
A) They are always easy to understand
B) They can become complex and clumsy with complicated logic
C) They require no symbols
D) They are not useful for documentation
E) They eliminate the need for testing

B) They can become complex and clumsy with complicated logic
Explanation: One of the disadvantages of flowcharts is that when the program logic is complicated, the flowchart can become complex and difficult to read.

p.15
C Tokens and Data Types

Why are variable names in C case sensitive?
A) To allow for more variable names
B) To differentiate between different variables
C) To make programming easier
D) To follow programming conventions
E) To reduce memory usage

B) To differentiate between different variables
Explanation: In C, variable names are case sensitive, meaning that names like total, Total, and TOTAL are treated as distinct variables.

p.14
C Tokens and Data Types

What is a string constant in C?
A) A sequence of characters enclosed in single quotes
B) A sequence of characters enclosed in double quotes
C) A single character
D) A numeric value
E) A variable name

B) A sequence of characters enclosed in double quotes
Explanation: A string constant is defined as a sequence of characters enclosed in double quotes, which can include letters, numbers, special characters, and blank spaces.

p.9
C Tokens and Data Types

Which symbol represents the 'at' symbol in ASCII?
A) 32
B) 64
C) 96
D) 33
E) 58

B) 64
Explanation: The ASCII value 64 corresponds to the '@' symbol, which is commonly used in email addresses and programming.

p.7
Introduction to C Language

What type of programming language is C classified as?
A) High-level programming language
B) Low-level programming language
C) Middle-level programming language
D) Scripting language
E) Markup language

C) Middle-level programming language
Explanation: C is often referred to as a middle-level programming language because it supports both high-level features and low-level operations.

p.29
Operators in C

How does the prefix operator differ from the postfix operator?
A) The prefix operator assigns before incrementing
B) The postfix operator assigns before incrementing
C) Both operators work the same way
D) The prefix operator cannot be used in loops
E) The postfix operator is faster than the prefix operator

A) The prefix operator assigns before incrementing
Explanation: The prefix operator first adds 1 to the operand and then assigns the result, while the postfix operator assigns the current value before incrementing.

p.16
C Tokens and Data Types

What is the size of a character data type in C?
A) 1 byte
B) 2 bytes
C) 4 bytes
D) 8 bytes
E) 16 bytes

A) 1 byte
Explanation: A character in C is typically stored in 1 byte (8 bits) of internal storage, allowing for a range of values depending on whether it is signed or unsigned.

p.18
C Tokens and Data Types

Which of the following statements would NOT work?
A) ݊݅ ݐ ܽ , ܾ , ܿ , ݀ ; ܽ = ܾ = ܿ = 10;
B) ݊݅ ݐ ܽ = 10;
C) ݊݅ ݐ ܽ = ܾ = ܿ = ݀ = 10;
D) ݊݅ ݐ ܽ = 10, ܾ = 20;
E) ݊݅ ݐ ܽ = 10, ܾ = 10;

C) ݊݅ ݐ ܽ = ܾ = ܿ = ݀ = 10;
Explanation: This statement would not work because it attempts to use variable ݀ before it is defined, leading to an error.

p.10
C Tokens and Data Types

How many keywords are available in C?
A) 16
B) 32
C) 64
D) 24
E) 48

B) 32
Explanation: There are a total of 32 predefined keywords in C, which have specific meanings known to the C compiler and cannot be used as variable names.

p.2
Flowchart Symbols and Guidelines

Which of the following is NOT an advantage of using flowcharts?
A) Makes logic clear
B) Acts as a guide during coding
C) Increases program complexity
D) Good for communication
E) Aids in system analysis

C) Increases program complexity
Explanation: Flowcharts are designed to simplify the understanding of logic and processes, not to increase complexity. They help clarify logic and improve communication.

p.14
C Tokens and Data Types

What value does zero (0) represent in C logical constants?
A) True
B) False
C) Undefined
D) Null
E) One

B) False
Explanation: In C, a logical constant of zero (0) represents a false value, while any non-zero value represents true.

p.3
Flowchart Symbols and Guidelines

What do flowchart symbols represent?
A) The programming language used
B) Different geometric shapes used in flowcharts
C) The complexity of the program
D) The speed of execution
E) The number of errors in the program

B) Different geometric shapes used in flowcharts
Explanation: Flowchart symbols are different geometric shapes that are used to represent various types of actions or steps in a flowchart, providing a standardized way to visualize processes.

p.12
C Tokens and Data Types

What does an octal integer constant start with?
A) 0x
B) 0b
C) 0
D) 0d
E) 0f

C) 0
Explanation: An octal integer constant consists of any combination of digits from 0 through 7 and begins with a 0.

p.9
C Tokens and Data Types

What is the ASCII value for the digit '0'?
A) 48
B) 49
C) 50
D) 51
E) 52

A) 48
Explanation: The ASCII value for the digit '0' is 48, which is important for character representation and manipulation in C programming.

p.5
Flowchart Symbols and Guidelines

Why is it important to avoid the intersection of flow lines in a flowchart?
A) It makes the flowchart look more colorful
B) It can confuse the reader and reduce effectiveness
C) It is a requirement of programming languages
D) It makes the flowchart longer
E) It is not important at all

B) It can confuse the reader and reduce effectiveness
Explanation: Avoiding the intersection of flow lines is crucial for maintaining clarity and effectiveness in communication, as intersections can lead to confusion.

p.7
Properties of Algorithms

Which of the following features does C support?
A) Only high-level features
B) Only low-level features
C) Both high-level and low-level features
D) Only object-oriented features
E) Only functional features

C) Both high-level and low-level features
Explanation: C supports high-level features like control structures (if, else, goto) as well as low-level features such as bit manipulation and direct memory addressing using pointers.

p.16
C Tokens and Data Types

What is the range of signed integers in C?
A) 0 to 255
B) -32768 to 32767
C) -128 to 127
D) -2147483648 to 2147483647
E) 0 to 65535

B) -32768 to 32767
Explanation: The range of signed integers in C is typically from -32768 to 32767 for a 16-bit integer, as indicated in the provided data.

p.17
C Tokens and Data Types

How many bits does a long double data type use in C?
A) 32 bits
B) 64 bits
C) 80 bits
D) 128 bits
E) 256 bits

C) 80 bits
Explanation: The long double data type in C uses 80 bits, allowing for extended precision beyond that of float and double.

p.21
Input/Output Functions in C

What command is used to compile a C program in UNIX/LINUX systems?
A) compile helloworld.c
B) gcc helloworld.c -o helloworld
C) run helloworld.c
D) make helloworld.c
E) build helloworld.c

B) gcc helloworld.c -o helloworld
Explanation: The command 'gcc helloworld.c -o helloworld' is used to compile the C program and generate an executable file named 'helloworld'.

p.21
Input/Output Functions in C

What happens if you do not specify '-o helloworld' in the compilation command?
A) It creates a file named 'program.c'
B) It creates an executable file named 'a.out'
C) It generates an error
D) It creates a file named 'output.exe'
E) It does nothing

B) It creates an executable file named 'a.out'
Explanation: If '-o helloworld' is not specified, the compiler generates an executable file named 'a.out' by default.

p.3
Flowchart Symbols and Guidelines

What happens to a flowchart when alterations are required?
A) It remains unchanged
B) It may require complete re-drawing
C) It becomes easier to read
D) It automatically updates
E) It is no longer needed

B) It may require complete re-drawing
Explanation: If alterations or modifications are needed in a program, the corresponding flowchart may need to be completely redrawn, which can be time-consuming.

p.7
History

Which of the following languages is considered an offshoot of C?
A) ALGOL60
B) BCPL
C) Java
D) Python
E) FORTRAN

B) BCPL
Explanation: C is an offshoot of earlier languages like BCPL and B, which influenced its development and features.

p.2
Algorithms and Flowcharts

What is the purpose of Step 2 in the rectangle example?
A) Calculate the area
B) Read the values of length and breadth
C) Print the value of area
D) Calculate the circumference
E) Stop

B) Read the values of length and breadth
Explanation: Step 2 in the rectangle example involves reading the values of length and breadth, which are essential for calculating the area and circumference.

p.1
Algorithms and Flowcharts

What is the first step in the example algorithm for finding the sum and average of two numbers?
A) Print the value of s and avg
B) Divide the sum s by 2
C) Read the numbers a, b
D) Compute the sum of a & b
E) Store the result in variable avg

C) Read the numbers a, b
Explanation: The first step in the provided algorithm is to read the input numbers a and b, which is essential for performing the subsequent calculations.

p.14
C Tokens and Data Types

What is the purpose of backslash character constants in C?
A) To define variables
B) To represent special characters in output functions
C) To create string constants
D) To perform arithmetic operations
E) To declare constants

B) To represent special characters in output functions
Explanation: Backslash character constants, or escape sequences, are used in output functions to represent special characters, even though they consist of two characters.

p.17
C Tokens and Data Types

What is the precision of a double data type in C?
A) 6 digits
B) 10 digits
C) 14 digits
D) 32 digits
E) 64 digits

C) 14 digits
Explanation: The double data type in C provides a precision of 14 digits, using 64 bits.

p.17
C Tokens and Data Types

Which of the following is NOT a derived data type in C?
A) Array
B) Structure
C) Union
D) Float
E) Pointer

D) Float
Explanation: Float is a basic data type, while array, structure, union, and pointer are considered derived or secondary data types.

p.21
Input/Output Functions in C

Which of the following is a formatted I/O function in C?
A) read()
B) write()
C) printf()
D) input()
E) display()

C) printf()
Explanation: 'printf()' is a formatted I/O function in C used for outputting data to the screen, allowing for formatted display of variables and messages.

p.18
C Tokens and Data Types

What does the 'volatile' qualifier indicate about a variable?
A) It is a constant variable
B) It can only be modified by the program
C) Its value may change due to external factors
D) It is a pointer variable
E) It is an array variable

C) Its value may change due to external factors
Explanation: The 'volatile' qualifier tells the compiler that the variable's value may be altered by external processes, prompting the compiler to check its value each time it is accessed.

p.15
C Tokens and Data Types

Which of the following is a valid variable name in C?
A) 2ndVariable
B) total amount
C) fyear_9899
D) total#
E) my variable

C) fyear_9899
Explanation: fyear_9899 is a valid variable name as it starts with a letter and contains letters, digits, and underscores without any spaces or invalid characters.

p.25
Input/Output Functions in C

What does the putch() function do?
A) It reads a string from input
B) It prints any alphanumeric character
C) It clears the screen
D) It reads a character from a file
E) It accepts multiple characters at once

B) It prints any alphanumeric character
Explanation: The putch() function is used to print any alphanumeric character taken from the standard input device, as described in the provided content.

p.11
C Tokens and Data Types

What is the result of converting the binary number 1011 to decimal?
A) 8
B) 10
C) 11
D) 12
E) 13

C) 11
Explanation: The binary number 1011 converts to decimal as 1*2^3 + 0*2^2 + 1*2^1 + 1*2^0, which equals 8 + 0 + 2 + 1 = 11.

p.16
C Tokens and Data Types

What is the typical storage size of an integer in C?
A) 1 byte
B) 2 bytes
C) 4 bytes
D) 8 bytes
E) Machine dependent

E) Machine dependent
Explanation: The size of an integer in C is machine dependent, typically occupying one word of storage, which can vary between 16 or 32 bits depending on the computer architecture.

p.14
C Tokens and Data Types

What is a variable in C?
A) A fixed value
B) A name for a memory location that can hold different values
C) A type of constant
D) A function
E) A string constant

B) A name for a memory location that can hold different values
Explanation: A variable in C is defined as a name given to a memory location where the variable value can vary during program execution, allowing it to hold different values.

p.21
C Tokens and Data Types

What file extension is used for the machine code generated by the C compiler?
A) .exe
B) .c
C) .obj
D) .out
E) .bin

C) .obj
Explanation: The machine code generated by the C compiler is saved with the extension '.obj', indicating it is an object file.

p.17
C Tokens and Data Types

What is the size of the void data type in C?
A) 1 byte
B) 2 bytes
C) 4 bytes
D) 0 bytes
E) 8 bytes

D) 0 bytes
Explanation: The void data type in C indicates that there is no data type, and its size is 0 bytes.

p.28
Operators in C

What do the increment (++) and decrement (--) operators do in C?
A) They multiply or divide the operand
B) They add or subtract one from the operand
C) They assign a value to the operand
D) They compare two operands
E) They convert the operand to a string

B) They add or subtract one from the operand
Explanation: The increment operator (++) adds one to the operand, while the decrement operator (--) subtracts one from the operand, making them useful for counting and looping.

p.20
Basic Structure of a C Program

Which of the following is true about comments in C?
A) They can be nested
B) They must be written in uppercase
C) They cannot be split into multiple lines
D) They can be added to make programs understandable
E) They must end with a semicolon

D) They can be added to make programs understandable
Explanation: Comments are used in C to make programs more understandable, and they can be split into multiple lines but cannot be nested.

p.26
Arithmetic Expressions/Instructions

What does the modulo division operator (%) do in C?
A) Adds two numbers
B) Subtracts one number from another
C) Multiplies two numbers
D) Produces the remainder after division
E) Divides two numbers

D) Produces the remainder after division
Explanation: The modulo division operator (%) in C returns the remainder of integer division, which is a key function in arithmetic operations.

p.25
Input/Output Functions in C

Which function is used to read a string of characters in C?
A) putchar()
B) putch()
C) gets()
D) getchar()
E) getch()

C) gets()
Explanation: The gets() function is used to read a string of characters from standard input, while puts() is used to write a string to the output.

p.23
C Tokens and Data Types

Which data type is used to store a single character in C?
A) int
B) float
C) char
D) double
E) string

C) char
Explanation: The 'char' data type is specifically designed to store single characters in C programming.

p.14
C Tokens and Data Types

Which of the following is an escape sequence in C?
A) \n
B) \z
C) \x
D) \y
E) \m

A) \n
Explanation: The escape sequence \n represents a new line in C, and it is one of the special characters used in output functions.

p.8
Introduction to C Language

What is the purpose of a C compiler?
A) To translate high-level languages to machine code
B) To create graphical user interfaces
C) To manage databases
D) To write web applications
E) To design video games

A) To translate high-level languages to machine code
Explanation: A C compiler combines assembly language capabilities with high-level language features, making it suitable for writing both system software and business packages by translating C code into machine code.

p.1
Properties of Algorithms

Which property ensures that an algorithm can handle all problems of a particular type?
A) Fitness
B) Definite
C) Effectiveness
D) Generality
E) Input/Output

D) Generality
Explanation: Generality refers to the completeness of an algorithm, ensuring that it can successfully solve all problems of a specific type for which it is defined.

p.29
Operators in C

What does the bitwise AND operator '&' do?
A) Adds two numbers
B) Performs logical AND on bits
C) Shifts bits to the left
D) Shifts bits to the right
E) Inverts the bits

B) Performs logical AND on bits
Explanation: The bitwise AND operator '&' performs a logical AND operation on each corresponding bit of two numbers in their binary form.

p.4
Flowchart Symbols and Guidelines

In which direction should the flow of a procedure or system typically move in a flowchart?
A) Right to left
B) Top to bottom
C) Bottom to top
D) Left to right or top to bottom
E) Diagonally across the page

D) Left to right or top to bottom
Explanation: The usual direction of flow in a flowchart is from left to right or top to bottom, which helps in maintaining a logical and easy-to-follow structure.

p.28
Operators in C

What does the Logical NOT operator do in C?
A) It adds one to its operand
B) It reverses the truth value of its operand
C) It multiplies its operand by two
D) It assigns a value to a variable
E) It checks if the operand is zero

B) It reverses the truth value of its operand
Explanation: The Logical NOT operator in C is used to reverse the truth value of its operand, meaning if the operand is false (F), it becomes true (T).

p.30
Operators in C

What does the left shift operator (<<) do?
A) It adds two numbers
B) It shifts bits to the right
C) It shifts bits to the left
D) It inverts the bits
E) It performs a logical OR

C) It shifts bits to the left
Explanation: The left shift operator (<<) shifts the bits of a variable to the left by a specified number of positions, filling the low-order bits with zeros.

p.13
C Tokens and Data Types

What distinguishes a single character constant from a number in C?
A) It must be enclosed in double quotes
B) It must be a letter
C) It is enclosed in single quotes
D) It cannot be a digit
E) It must be a special character

C) It is enclosed in single quotes
Explanation: A single character constant is defined as a character enclosed within single quotes, distinguishing it from numeric values.

p.5
Flowchart Symbols and Guidelines

How can the validity of a flowchart be tested?
A) By making it more complex
B) By passing through it with simple test data
C) By asking others to draw it
D) By changing its colors
E) By removing all annotations

B) By passing through it with simple test data
Explanation: Testing the validity of a flowchart by using simple test data helps to verify that the flowchart accurately represents the intended process.

p.30
Operators in C

Which of the following is NOT a special operator in C?
A) Comma operator
B) Sizeof operator
C) Pointer operator
D) Bitwise AND operator
E) Member selection operator

D) Bitwise AND operator
Explanation: The bitwise AND operator is a standard operator in C, while the comma operator, sizeof operator, pointer operators, and member selection operators are considered special operators.

p.17
C Tokens and Data Types

What is the correct syntax for declaring a variable in C?
A) variable1 variable2;
B) int variable1, variable2;
C) variable1: int, variable2: int;
D) declare variable1, variable2;
E) var variable1, variable2;

B) int variable1, variable2;
Explanation: The correct syntax for declaring variables in C includes specifying the data type followed by the variable names, separated by commas, and ending with a semicolon.

p.17
C Tokens and Data Types

What does the type declaration instruction in C do?
A) It initializes variables only.
B) It defines the scope of variables.
C) It declares the type of variables being used.
D) It deletes variables from memory.
E) It converts data types.

C) It declares the type of variables being used.
Explanation: The type declaration instruction is used to declare the type of variables in a C program, specifying what kind of data they will hold.

p.18
Input/Output Functions in C

What is the purpose of format codes in C?
A) To define variable types
B) To represent data types in output
C) To declare constants
D) To create functions
E) To manage memory allocation

B) To represent data types in output
Explanation: Format codes are used to specify how data types should be represented in output, ensuring that the output is formatted correctly.

p.15
C Tokens and Data Types

What are the three broad classifications of data types in C language?
A) Integer, Float, Double
B) Primary, Derived, User-defined
C) Simple, Complex, Array
D) Static, Dynamic, Temporary
E) Numeric, Character, Boolean

B) Primary, Derived, User-defined
Explanation: C language data types can be broadly classified into primary data types, derived data types, and user-defined data types, which help in defining the type of data stored in memory.

p.30
Operators in C

What does the one's complement operator (~) do?
A) It adds two numbers
B) It shifts bits to the left
C) It inverts the bits of a number
D) It performs a logical OR
E) It performs a logical AND

C) It inverts the bits of a number
Explanation: The one's complement operator (~) inverts each bit of a number, turning 1s into 0s and 0s into 1s.

p.12
C Tokens and Data Types

Which of the following is a valid octal integer?
A) 0347
B) 128
C) 0x1A
D) 256
E) 0b1010

A) 0347
Explanation: 0347 is a valid octal integer as it consists of digits from 0 to 7 and starts with a 0.

p.17
C Tokens and Data Types

What is the size of a float data type in C?
A) 2 bytes
B) 4 bytes
C) 8 bytes
D) 10 bytes
E) 16 bytes

B) 4 bytes
Explanation: The float data type in C is stored in 4 bytes (32 bits), which allows for 6 digits of precision.

p.23
C Tokens and Data Types

What is the correct format specifier for a float value in C?
A) %d
B) %c
C) %f
D) %s
E) %i

C) %f
Explanation: The format specifier '%f' is used to display float values in C programming.

p.28
Operators in C

Which of the following is an example of a shorthand assignment operator?
A) x = x + 1
B) x += 1
C) x - 1
D) x = 1
E) x * 1

B) x += 1
Explanation: The shorthand assignment operator x += 1 is equivalent to x = x + 1, allowing for more concise and readable code.

p.20
Basic Structure of a C Program

What must all C statements end with?
A) A period (.)
B) A comma (,)
C) A semicolon (;)
D) A colon (:)
E) An exclamation mark (!)

C) A semicolon (;)
Explanation: All C statements must end with a semicolon (;), which is a fundamental rule in C programming to indicate the end of a statement.

p.21
Input/Output Functions in C

What is the purpose of the 'scanf()' function in C?
A) To display messages on the screen
B) To read input from the user
C) To compile the program
D) To create an executable file
E) To write data to a file

B) To read input from the user
Explanation: The 'scanf()' function is used for formatted input in C, allowing the program to read data values supplied by the user.

p.24
Input/Output Functions in C

What is the main difference between getch() and getche() functions?
A) getch() waits for the enter key, while getche() does not
B) getche() does not display the character, while getch() does
C) getch() does not wait for the enter key and does not display the character, while getche() does not wait for the enter key but echoes the character
D) Both functions wait for the enter key
E) Both functions display the character on the screen

C) getch() does not wait for the enter key and does not display the character, while getche() does not wait for the enter key but echoes the character
Explanation: getch() allows for input without waiting for the enter key and does not display the character, while getche() also does not wait for the enter key but shows the character on the screen.

p.13
C Tokens and Data Types

Which of the following is a valid floating point constant?
A) 12e - 2
B) 3.18E3
C) - 1.2E - 1
D) All of the above
E) None of the above

D) All of the above
Explanation: All listed options are valid floating point constants, demonstrating the correct use of exponential notation.

p.12
C Tokens and Data Types

What prefix is used for hexadecimal integer constants?
A) 0b
B) 0d
C) 0x or 0X
D) 0o
E) 0f

C) 0x or 0X
Explanation: Hexadecimal integer constants are preceded by 0x or 0X, indicating that the number is in base sixteen.

p.29
Operators in C

In the expression 'x = (a > b) ? a : b;', what value will x hold if a = 10 and b = 15?
A) 10
B) 15
C) 0
D) 25
E) 5

B) 15
Explanation: Since a (10) is not greater than b (15), the condition evaluates to false, and x is assigned the value of b, which is 15.

p.16
C Tokens and Data Types

What is the difference between signed and unsigned integers?
A) Signed integers can only be positive
B) Unsigned integers can be negative
C) Signed integers use one bit for sign
D) Unsigned integers use one bit for sign
E) There is no difference

C) Signed integers use one bit for sign
Explanation: Signed integers use one bit for the sign (positive or negative), while unsigned integers are always positive and use all bits for the magnitude of the number.

p.20
Basic Structure of a C Program

What is a requirement for the function's body in C?
A) It must be written in uppercase
B) It must be enclosed within braces
C) It can be empty
D) It must contain at least one statement
E) It must be written in a single line

B) It must be enclosed within braces
Explanation: The body of a function in C must be enclosed within opening and closing braces ({ }), which define the scope of the function.

p.20
Input/Output Functions in C

What key combination is used to compile a program in Turbo C?
A) Ctrl+F9
B) Alt+F5
C) Alt+F9
D) Shift+F9
E) Ctrl+F5

C) Alt+F9
Explanation: In Turbo C, the key combination Alt+F9 is used for compiling a program, making it user-friendly for developers.

p.25
Input/Output Functions in C

In the provided program, what does the function getche() do?
A) It reads a character without displaying it
B) It reads a character and displays it immediately
C) It clears the console screen
D) It reads a string of characters
E) It prints a string to the output

B) It reads a character and displays it immediately
Explanation: The getche() function reads a character from the input and displays it immediately on the screen, which is shown in the example program.

p.21
C Tokens and Data Types

What is the file extension for C source files?
A) .exe
B) .obj
C) .c
D) .txt
E) .bin

C) .c
Explanation: In C language, every source file is saved with the extension '.c', which is standard for C programming files.

p.28
Operators in C

What is the main advantage of using shorthand assignment operators?
A) They are always faster
B) They require more code
C) They make the code less readable
D) They reduce repetition and improve readability
E) They can only be used with integers

D) They reduce repetition and improve readability
Explanation: Shorthand assignment operators reduce the need to repeat the variable on the left-hand side, making the code easier to write and read.

p.28
Operators in C

What is a logical expression in C?
A) An expression that only contains integers
B) An expression that yields a value of one or zero
C) An expression that contains only arithmetic operators
D) An expression that cannot be assigned to a variable
E) An expression that always evaluates to true

B) An expression that yields a value of one or zero
Explanation: A logical expression in C is defined as one that contains a logical operator and yields a value of either one (true) or zero (false).

p.29
Operators in C

What is the purpose of the conditional operator in C?
A) To perform arithmetic operations
B) To construct conditional expressions
C) To manipulate bits
D) To declare variables
E) To create loops

B) To construct conditional expressions
Explanation: The conditional operator (?:) allows for the construction of conditional expressions, evaluating one of two expressions based on the truth value of a condition.

p.28
Operators in C

What is the purpose of the assignment operator (=) in C?
A) To compare two values
B) To assign the result of an expression to a variable
C) To increment a variable
D) To perform logical operations
E) To declare a variable

B) To assign the result of an expression to a variable
Explanation: The assignment operator (=) is used in C to assign the result of an expression to a variable, allowing for value storage and manipulation.

p.17
C Tokens and Data Types

What keyword is used to define a floating point number in C?
A) int
B) char
C) float
D) double
E) void

C) float
Explanation: Floating point numbers in C are defined using the keyword 'float'.

p.30
Operators in C

What happens to the high-order bits during a right shift operation?
A) They are filled with ones
B) They are filled with zeros
C) They are discarded
D) They remain unchanged
E) They are inverted

B) They are filled with zeros
Explanation: During a right shift operation, the high-order bits are filled with zeros, while the bits are shifted to the right by the specified number of positions.

p.18
C Tokens and Data Types

What is the result of the expression ܾ = 1.99 + 2.4 * 1.44?
A) 5.0
B) 3.0
C) 4.0
D) 6.0
E) 7.0

A) 5.0
Explanation: The expression evaluates to 1.99 + (2.4 * 1.44) = 1.99 + 3.456 = 5.446, which rounds to approximately 5.0.

p.18
Properties of Algorithms

Why is the order of variable definition important in some cases?
A) It affects the program's speed
B) It determines the variable's data type
C) It can lead to using an uninitialized variable
D) It changes the variable's scope
E) It has no effect on the program

C) It can lead to using an uninitialized variable
Explanation: The order of variable definition is crucial when a variable is used before it is defined, which can lead to errors in the program.

p.20
Basic Structure of a C Program

What is the significance of the main() function in a C program?
A) It can be named anything
B) It is optional
C) It must be the only function
D) It is where program execution starts and ends
E) It contains all variable declarations

D) It is where program execution starts and ends
Explanation: The main() function is crucial as it is the entry point for program execution in C, and every C program must have one main() function.

p.24
Input/Output Functions in C

Which of the following statements about unformatted I/O functions is true?
A) They require conversion symbols for data types
B) They only work with integer data types
C) They return values, and the return value is always the same
D) They can read and write formatted data
E) They are only used for string data types

C) They return values, and the return value is always the same
Explanation: Unformatted I/O functions do return values, and it is noted that the return value is consistently the same, which simplifies their use.

p.12
C Tokens and Data Types

What range of digits do hexadecimal integers use?
A) 0-9
B) 0-7
C) 0-15
D) 0-16
E) 0-5

C) 0-15
Explanation: Hexadecimal integers use digits from 0 to 9 and letters A to F (or a to f) to represent values from 10 to 15.

p.29
Operators in C

Which of the following is NOT a bitwise operator in C?
A) &
B) |
C) ^
D) +
E) <<

D) +
Explanation: The '+' operator is an arithmetic operator, not a bitwise operator. The other options (&, |, ^, <<) are all bitwise operators used for manipulating bits.

p.16
C Tokens and Data Types

What is the range of unsigned characters in C?
A) -128 to 127
B) 0 to 255
C) 0 to 65535
D) -32768 to 32767
E) 0 to 4294967295

B) 0 to 255
Explanation: Unsigned characters in C have values ranging from 0 to 255, as they do not use any bits for sign.

p.18
C Tokens and Data Types

What does the keyword 'const' signify when declaring a variable?
A) The variable can be modified
B) The variable's value is constant
C) The variable is a pointer
D) The variable is an array
E) The variable is a function

B) The variable's value is constant
Explanation: The 'const' qualifier indicates that the variable's value cannot be modified during the execution of the program.

p.20
Input/Output Functions in C

What happens when you press Ctrl+F9 in Turbo C?
A) It compiles the program
B) It exits the program
C) It executes the program
D) It saves the program
E) It opens a new file

C) It executes the program
Explanation: Pressing Ctrl+F9 in Turbo C will execute the compiled program, allowing the user to see the output.

p.28
Operators in C

What is the difference between pre-increment (++m) and post-increment (m++)?
A) There is no difference
B) Pre-increment does the operation first, post-increment does it after
C) Post-increment is faster than pre-increment
D) Pre-increment can only be used with integers
E) Post-increment cannot be used in expressions

B) Pre-increment does the operation first, post-increment does it after
Explanation: Pre-increment (++m) performs the increment operation before any assignment, while post-increment (m++) performs it after, affecting the order of operations in expressions.

Study Smarter, Not Harder
Study Smarter, Not Harder