Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
1. What are tokens, identifiers, literals. Pl learn the naming conventions of these.
· Tokens- Smallest individual unit. Following are the tokens
· Keyword-Reserve word having special meaning the language and can’t be used as
o identifier.
· Identifiers-Names given to any variable, function, class, union etc. Naming
convention (rule) for writing identifier is as under:
o First letter of identifier is always alphabet.
o Reserve word cannot be taken as identifier name.
o No special character in the name of identifier except under score sign ‘_’.
· Literals-Value of specific data type assign to a variable or constant. Four type of
Literals: i) Integer Literal i.e int x =10 ii) Floating point Literal i.e float x=123.45
§ iii)Character Literal i.e char x= ‘a’, enclosed in single quotes and single character
only. iv) String Literal i.e cout<< “Welcome” , anything enclosed in double
quotes
· Operator – performs some action on data o Arithmetic(+,-
,*,/,%) o Assignment operator (=) o Increment / Decrement (++, --
) o Relational/comparison (<,>,<=,>=,==,!=). o Logical(AND(&&),OR(||),NOT(!).
o Conditional (? :)
#include <iostream.h>
#define area_square(s) s*s
void main()
{ cout<<"Area of square: "<<area_square(4);
}
output:
Area of square: 16
4. What is typedef? How to define another name for string, int, float or char datatypes?
Used to define new data type name.
e.g. typedef char Str80[80];
Str80 str;
So the new name for char data type here will be Str80. str is a variable of Str80
having size as 80 char.
eg 2. typedef int age;
age x;
Here Age is the new name for int data type . x is a variable having age data type.
Variables which contains copy of actual parameters inside the function definition.
18. What do you mean by entry controlled and exit controlled loop?
19. Entry control loop works for true condition and preferred for fixed no.of times.eg
for, while
20. Exit Control Loop execute at least once if the condition is false at beginning.eg
do while
21. Difference between signed and unsigned.
The range of signed data type is lower than unsigned as one byte is reserved to store
the sign(-, +)
Eg
For char datatype.
1byte signed: -128 to 127
unsigned: 0 to 255
22. What do you understand by .h in header file declarations?
23. .h stands for header files, an extension given to these types of files.
24. Why do we use comments? Declare a single line comment and a multi line comment.
COMMENTS in a C++ program.:
Comments are the line that compiler ignores to compile or execute. There are two
types of comments
in C++.
1. Single line comment: This type of comment deactivates only that line where
comment is
applied. Single line comments are applied with the help of “ //” .
e.g // cout<<tomorrow is holiday
the above line is proceeding with // so compiler wont access this line.
2. Multi line Comment: This Type of comment deactivates group of lines when
applied. This type of
comments are applied with the help of the operators “/*” and “*/ ”. These comment
mark with /*
and end up with */. This means everything that falls between /*and */ is
considered even though it
is spread across many lines.
e.g #include<iostream.h>
int main ()
{
cout<< “ hello world”;
/* this is the program to print hello world
For demonstration of comments */
}
In the above program the statements between /* and */ will be ignored by the
compiler.
CHAPTER 5 INHERITENCE
Various visibility modes in inheritance
Uses of function overloading and inheritance.
Name and elaborate on the types of Inheritance.
What do you understand by transitive nature in inheritance?
CHAPTER 9 POINTERS
Difference between stack as an array and stack as a linked list.
Uses of pointers.
What is dynamic data structures ?
What is A in char A[10]
How can we declare dynamic arrays?
Consider the declaration : char *s[20] :- is it a 1-D or 2-D array ? Why?
What do you understand by static and dynamic memory? Give examples.
CHAPTER 11 FILE HANDLING
Differentiate between read and write function and explain them in detail.
Definition of file & stream
Diff between files and linked list
Diff between files & arrays
How are records implemented in C++?
Diff between binary & text files
Which is base class fstream / iostream
Difference between linked list and files.
Diff between file & array
Writing/Reading characters to/from file
Writing/Reading strings to/from file
Diff between text & binary file
Writing/Reading objects to/from file
Add / modifying / delete from a file
CHAPTER 12 MY SQL
What is DDL and DML?
I have item .dbf having fields item no. & category. Give command to count the total
number of items in each category
61. Student by having fields Roll no., Class, Section count total number of students
in each section of class XII. How can we make changes in one particular column of a
table