You are on page 1of 3

VIVA QUESTIONS 1. Revision Tour 1.1. What are keywords?

Keywords are reserve words are those words which convey a special meaning to compiler. Such as char,int,if ,else,switch etc. 1.2. What is escape sequence? An escape sequence is represented by \ backslash character followed by one more characters. Such as \n,\t,\b etc. 1.3. What is difference between 0, 0 , 0 , \0 ? 0 means integer value , 0 character , 0 String constant , \0 NULL character which signifies end of string. 1.4. What are fundamental data types ? Fundamental (Atomic) data types are those which are not composed of other data types. Example int,char ,void,double,float. 1.5. What is the significance of data type modifiers? Data modifiers are used to alter the base type, such as it increases the range of values. Data type modifiers are long,short,signed and unsigned. Signed and unsigned data type is only used with integral data types such as char or int. 1.6. Give the size of the following data bytes : (i) Int (ii) char (iii) float (iv) long (v) double (vi) long double (vii) unsigned char (viii) short 1.7. What is auto variable ? auto variables are automatic variables , variables are auto by default. 1.8. What is static variable ? static variables are those variables which are initialised only at first function call. 1.9. Differentiate between array and structure? Array is group of similar data types where as structure is group of different data types. 1.10. Differentiate between structure and class ? Ans. In structure all members are public by default where as in case of class all members are private by default. 1.11. What is reference variable? Reference variables are alternate name of variable. 1.12. Setw(),setprecision(),setf etc. ? iomanip.h 1.13. Sizeof operator gives size of a data type. 1.14. Ternary or conditional operator (? :) 1.15. Logical operators ! Not &&And || OR . Relational operator < > !=,>=,<= . Arithmetic op. +,-,*,/,% 1.16. Implicit type conversion and explicit type conversion or type casting (explicit conversion of an operand to a specific type). 1.17. Entry controlled loop for and while , exit controlled loop do..while loop 1.18. Difference between for and while loop is for loop has three parts initialisation, condition and updation whereas in while loop only condition is specified withtin ( ) and updation is inside the loop and initialisation is before the loop. 1.19. Main difference between while and do..while loop is that do..while loop executes atleast once evenif the condition is false. 1.20. Difference between if and switch switch can only be used with integral datatypes, single variable and only for equality whereas with if it is possible to apply more than one condition on more than one variable. 1.21. What is dangling if else in nested if when braces donot match as per the condition is called dangling if else. It can be rectified by placing proper braces. 1.22. What are jump statements explain.

1.23. Jump statements are those statements which can transfer control to the other part of the program. Break immediately take out from the block or loop. Continue takes the control back to next iteration. Goto takes control to the specified label. Return takes out the control from the function . 1.24. What is difference between iteration and recursion? Iteration repetition (loop) Recursive function call itself.(without loop) 1.25. Difference between getch() and getche(). Getch() donot echo character back on the screen whereas getche() echoes back (i.e.) displays the entered character on the screen. 1.26. Difference between getc/getchar and gets()? Gets() function is used to accept string and getc() / getchar() is used to accept only character. 1.27. Use of randomize() and random. 1.28. Difference between function prototype and function defintion. Function prototype is a declaration of the function that tells about the function to compiler, whereas function definition consists of function header and its body. 1.29. Global scopeand local scope 1.30. Call by value and call by reference 1.31. Header files and their functions. 1.32. In output questions (cascading start from right to left) 2. Object Oriented Programmimng 2.1. What do you understand by OOPs? Object oriented programming means data and functions are enclosed in a single unit called class. Concept revoloves around the oblect. 2.2. What is polymprphism, Inheritance,Object, encapsulation data abstraction etc. 3. Function Overloading 3.1. How the best match is done when u call the program? Match A Match,No match, Ambiguous match 3.2. A function can be called overloaded only on the basis of their parameters or signature , not on the return type. 4. Classes and Object 4.1. What is a class? 4.2. Why encapsulation is called so? 4.3. What is significance of class? 4.4. What is difference between private and public class members? 4.5. What is difference between member functions defined outside or inside the class? 4.6. When functions are defined inside the class, they automatically becomes inline means code gets expanded at the time of compiling. Whereas functions defined outside the class works likes ordinary functions. 4.7. What are inline functions? Ans - Whose code gets expanded in place of calling statement at the time of compilation. 4.8. Scope of private , public and private members. 4.9. Global class/object , local class/object 4.10. Containership / Nesting of classes 4.11. Static members of class have class scope, declared inside the class but initialised outside the class with full definition . static memberfunctions are declared with keyword static and can access only static data members. Called by calss name and ::.

4.12. Use of scope resolution operator used with class name to depict the class member and also used to depict the scope of global variable. 4.13. When objects of a class are defined, copies of data member is created but there is only one copy of static data members which is shared by all objects of the class. 4.14. Size of empty class and struct is 1 byte.

You might also like