Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors

Sequence Control & Expression | PPL

SEQUENCE CONTROL AND EXPRESSION
 
Viva Voce on Sequence control & expression
 
Q1. Describe static function with its usage?
Ans) A function, which has a function definition prefixed with a static keyword is defined as a static function. The static function should call within the same source code.
Q2. Describe Wild Pointers in C?
Ans) Uninitialized pointers in the C code are known as Wild Pointers. These are a point to some arbitrary memory location and can cause bad program behaviour or program crash.
Q3. What is the difference between ++a and a++?
Ans) ‘++a”  is called prefixed increment and the increment will happen first on a variable. ‘a++’ is called postfix increment and the increment happens after the value of a variable used for the operations.
Q4. Describe the difference between = and == symbols in C programming?
Ans) ‘==’ is the comparison operator which is use to compare the value or expression on the left-hand side with the value or expression on the right-hand side.
‘=’ is the assignment operator which is use to assign the value of the right-hand side to the variable on the left-hand side.
Q5. What is the explanation for prototype function in C?
Prototype function is a declaration of a function with the following information to the compiler.
  • Name of the function.
  • The return type of the function.
  • Parameters list of the function.
Q6. Describe the header file and its usage in C programming?
Ans) The file contains the definitions and prototypes of the functions being used in the program are called a header file. It is also known as a library file.
Q7. What is a nested loop?
Ans) A loop running within another loop is referred as a nested loop.
Q8. What is a pointer on a pointer in C programming language?
Ans) A pointer variable that contains the address of another pointer variable.
Q9. What are the valid places to have keyword “Break”?
Ans)  Only in Looping or switch statements.

MCQs on Sequence control on expressions

Q1. The break statement is used to exit from
a.  DO loop
b.  FOR loop
c. all of above

Q2. In which statements, does a CONTINUE statement cause the control to go directly to the test condition and then continue the looping process?
a. FOR and WHILE
b. WHILE and IF-ELSE
c. While and DO-WHILE

Q3. The advantage of a SWITCH statement over an ELSE-IF statement
a. A default condition can be used in the SWITCH
b. The SWITCH is easier to understand1
c. Several different statements can be executed in a SWITCH
Q4. The traditional way to create an infinite loop in C is
a. FOR ( ; ; )
b. IF (=) BREAK;
c. WHILE ()…
Q5. The most common use of the one-dimentional array in C is the
a. String
b. Character
c. Data
Q6. C provides loop constructs for performing loop operations. They are
a. The WHILE statement
b. The DO statement
c. The FOR statement
 
MCQs Answers
Q1. (c)
Q2. (c)
Q3. (b)
Q4. (a)
Q5. (c)
Q6. (b)

References:

  1. Sebesta,”Concept of programming Language”, Pearson Edu
  2. Louden, “Programming Languages: Principles & Practices” , Cengage Learning
  3. Tucker, “Programming Languages: Principles and paradigms “, Tata McGraw –Hill.
  4. E Horowitz, “Programming Languages”, 2nd Edition, Addison Wesley

Leave a Comment