Thứ Tư, 6 tháng 4, 2011

Check your progress - PC

Session 1 & 2:
1.    C allows compartmentalization of code and data.    True
2.    The number 10 is a whole number.
3.    A flowchart can have any number of start and stop points.    False
4.    Using the type float saves memory as it takes only half the space as a double would.
5.    Unary and Binary are two classes of arithmetic operators.
6.    Flowcharts help us review and debug programs easily.    True
7.    C is case sensitive.    True
8.    A flowchart is a diagrammatic representation that illustrates the sequence of operations to be performed to arrive at a solution.
9.    A loop or iterative construct is basically the execution of a sequence of statements until a particular condition is True or False.
10.    The unary arithmetic operator are ++ and.
11.    The void data type is used to indicate the C compiler that no value is being returned.

Session 3:
1.    Precedence establishes the hierarchy of one set of operators over another when an arithmetic expression has to be evaluated.
2.    Mixed Mode Expression is one in which the operands of an operator belong to different data types.
3.    Operators are the tools that manipulate data.
4.    The precedence of operators can be overridden by enclosing the required part of the expression in Parentheses.
5.    A/An Expression consists of a combination of operators and operands.
6.    Bitwise logical operators are &, |, \~ and ^.
7.    Logical Operators are used to combine or negate expressions containing relational operators.
8.    An expression can be forced to be of a certain type by using a Cast.

Session 4:
1.    A Buffer is a temporary storage area in memory.
2.    Format specifier specify the form by which the values of the variables are to be input and printed.
3.    Escape sequence can be placed outside the control string in printf().        False 
4.    % is used by the printf() function to identify conversion specifications.
5.    getchar() is a function without any arguments.                    True
6.    scanf() uses pointers  to variables rather than variable names.
7.    The formatted I/O functions are prinft() and scanf().

Session 5:
1.    Conditional statements enable us to change the flow of a program.
2.    A Nested if  is an if statement, which is placed within another if or else.
3.    The else statement is optional.                            True
4.    The switch statement is a multi-way decision maker that tests the value of an expression against a list of integer or character constants.

Session 6:
1.    The exit function causes  immediate termination of the program and control is transferred back to the operating system.
2.    The return statement causes execution to return to the point at which the call to the function was made.
3.    while loop loops check the condition at the top of the loop which means the loop code is not executed, if the condition is false at the start.
4.    The do..while loop loop checks its condition at the end of the loop, that is after the loop has been executed.
5.    The goto statement violates the rules of a strictly structured programming language.
6.    A semicolon is used to separate the three parts of the expression in a for loop.
7.    Loop allows a set of instructions to be performed until a certain condition is reached.

Session 7:
1.    Each element of an array cannot be used where a variable is allowed or required.False
2.    Two arrays, even it they are of the same type and size, cannot be tested for Equality.
3.    Arrays can have more than one dimension. True
4.    The comparison of two strings is done with the help of strcmp whereas the interchanging is done by strcpy
5.    Each member of an array is identified by the unique Index or Subscript assigned to it.
6.    An array name and a variable name can be the same. False
7.    A String can be defined as a character type array, which is terminated by a NULL character.

Session 8:
1.    Addition and Subtraction are the only operations, which can be performed on pointers.
2.    A Pointer provides a way of accessing a variable without referring to the variable directly.
3.    The two special operators used with pointers are * and &.
4.    The Type of the pointer defines what type of variables the pointer can point to.
5.    The allocation of memory in this manner, that is, as and when required in a program is known as Dynamic Memory Allocation.
6.    Two pointers can be compared only if both these variables are pointing to variables of different types. False

Session 9:
1.    The function, which calls another function, is known as the Calling Function and the function, which is being called, is known as the Called Function.
2.    If the return is ignored, control passes to the calling program when the closing braces of the code block are encountered. This is termed as calling routine or calling function.
3.    Arguments appearing in the parentheses are termed as format Parameters
4.    Global Variables are visible to the entire program, and can be used by any piece of code.
5.    Local (Variables) can be referred to only by statements that are inside the code block, which declares them.
6.    A function is a self-contained program segment that carries out a specific, well-defined task.
7.    Arguments are said to be passed by value when the value of the variables are passed to the called function.
8.    In Call by reference the function is allowed access to the actual memory location of the argument.
9.    Scope rules govern whether one piece of code knows about or has access to another piece of code or data.
10.    A  Function Prototype is a function declaration that specifies the data types of the arguments.

Session 10:
1.    Maximum number of characters that can be input into the char arr[15] is 14.
2.    Strcmp() returns Zero if two strings are identical.
3.    Two pointers can be compared only if both these variables are pointing to variables of different types. True
4.    Modification of the string pointer can lead to data loss.                True
5.    When an array is passed to a function, only its address is passed.
6.    To use the strcat() function, the string.h header file must be included in the program.
7.    Strings are terminated by the NULL (\0) character.                    True
8.    In Call by reference the function is allowed access to the actual memory location of the argument.

Session End:
1.    Bubble sort, the Adjacent elements are compared.
2.    Individual structure elements are referenced through the use of the dot operator.
3.    A new data type name can be defined by using the typedef keyword.
4.    In insertion sort, if an unsorted element has to be put in a particular sorted location, values are swapped.                                    True
5.    A Structure groups together a number of data items, which need not be of the same data type
6.    Values of one structure variable can be assigned to another variable of the same type using a simple assignment statement.                            True
7.    It is impossible to have one structure within another structure.             False
8.    The fopen function opens a stream for use and links a file with that stream.
9.    The two types of streams are the text and binary streams.
10.    The current location of the current active pointer can be found with the help of the ftell function.
11.    The fgets() function considers a new line character as a part of the string.        True
12.    Open files are closed when a program crashes.                    False
13.    The rewind function resets the file position indicator to the beginning of the file.
14.    Whenever a character is read from or written to the stream, the File pointer is incremented.
15.    The function used for writing characters to a file is fputc.
16.    Files on which fread&() and fwrite() operate must be opened in binary mode.
17.    Which of the following switch statement is are illegal            None are illegal