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)
EasyExamNotes.com covered following topics in these notes.
Principles of Programming Languages:
EasyExamNotes.com covered following topics in these notes.
- Language Evaluation Criteria
- Influences on Language Design
- Language Categories
- Programming Paradigms
- Compilation
- Virtual Machines
- Programming Environments
- Issues in Language Translation
- Parse Tree
- Pointer and Reference type
- Concept of Binding
- Type Checking
- Strong typing
- Sequence control with Expression
- Exception Handling
- Subprograms
- Fundamentals of sub-programs
- Scope and lifetime of variable
- static and dynamic scope
- Design issues of subprogram and operations
- Local referencing environments
- Parameter passing methods
- Overloaded sub-programs
- Generic sub-programs
- Design issues for functions
- co routines
- Abstract Data types
- Abstraction and encapsulation
- Static and Stack-Based Storage management
- Garbage Collection
- OOP in C++
- OOP in Java
- OOP in C#
- OOP in PHP
- Concurrency
- Semaphores
- Monitors
- Message passing
- Java threads
- C# threads
- Exception handling
- Exceptions
- Exception Propagation
- Exception handler in C++
- Exception handler in Java
- Introduction and overview of Logic programming
- Basic elements of Prolog
- Application of Logic programming
- Functional programming languages
- Introduction to 4GL
Practicals:
- Memory Implementation of 2D Array.
- Memory Implementation of 3D Array.
- Implementation of pointers in C++.
- Write a program in Java to implement exception handling.
- Write a program in C++ to implement call by value parameter passing Method.
- Write a program in C++ to implement call by reference parameter passing Method.
- Write a program in Java to implement concurrent execution of a job using threads.
- Implement Inheritance in C#.
- Implement Encapsulation in C#.
- Implement static/compiletime Polymorphism in C#.
- Implement dynamic/runtime Polymorphism in C#.
Previous years solved papers:
A list of Video lectures
References:
- Sebesta,”Concept of programming Language”, Pearson Edu
- Louden, “Programming Languages: Principles & Practices” , Cengage Learning
- Tucker, “Programming Languages: Principles and paradigms “, Tata McGraw –Hill.
- E Horowitz, “Programming Languages”, 2nd Edition, Addison Wesley
- Memory Implementation of 2D Array.
- Memory Implementation of 3D Array.
- Implementation of pointers in C++.
- Write a program in Java to implement exception handling.
- Write a program in C++ to implement call by value parameter passing Method.
- Write a program in C++ to implement call by reference parameter passing Method.
- Write a program in Java to implement concurrent execution of a job using threads.
- Implement Inheritance in C#.
- Implement Encapsulation in C#.
- Implement static/compiletime Polymorphism in C#.
- Implement dynamic/runtime Polymorphism in C#.
Previous years solved papers:
A list of Video lectures
References:
- Sebesta,”Concept of programming Language”, Pearson Edu
- Louden, “Programming Languages: Principles & Practices” , Cengage Learning
- Tucker, “Programming Languages: Principles and paradigms “, Tata McGraw –Hill.
- E Horowitz, “Programming Languages”, 2nd Edition, Addison Wesley