Cs201p LAB 1 and 2 Quiz 1
Cs201p LAB 1 and 2 Quiz 1
2. Word processor is
Application software
Iteration
4. What is the correct syntax to declare an array of size 10 of int data type?
Int name[10];
5. Which of the following operator is used to access the value of variable pointer to by
a pointer
& operator
Necessary
Must
10. Which of the following function(s) is/are included in stdlib.h header file?
Double atof(const char*nptr), int atol(const char*nptr) ….. 1 and 2 only both
11. If we want to store a string abc in an array str then the size of this array must be at
least
11
13. Suppose we have declared a two dimensional array multi. To access elements using
pointer we should use referencing like ________.
*multi
Data,type,array,name,[size]
HelloWorld!
18. In C++ using if statement if we want to execute more than one statement then we
have to enclose all statement in ____________
{}
Error
True
0 – 99
22. What will be the value of a and b after executing the following statements?
A = 3; b = a++;
4,3
23. Which of the following function returns the size of a string variable?
True
25. If the file is not properly closed in the program, the program _______.
Terminate normally
26. Which of the following header file include string conversion functions?
String.h
28. IN C/C++ language the header file which is used to perform useful task and
manipulation
Ctype.h
Compiler
(b*b-4*a*c)/(2*a)
Compiler
X=X+3
Null
While
36. Function declaration is a one-line statement in which we write the return type,
_____ of the function and the ______ of arguments.
Output stream
Int*ptr;
45. In C++, what is the correct syntax for accessing the fifth element of an array?
A[4]
Break
47. Normally the float data type is half of the size of ________.
Double
48. A variable declared inside a code block becomes the _____ variable for that block.
Local
49. In C++, all the string manipulation function are defined inside _ header file.
String.h
Global
0 5 10
52. Which of the following C++ statements is used take input from the user?
Cin
Break
54. Learning how to program is important because it develops _______ and problem
solving abilities.
Analytical
55. Which of the following option is used when working with complicated expressions in
C++?
()
Two
57. Which of the following is the default function calling mechanism of C/C++?
Call by value
58. In C++ which of the following option has the correct meaning of the expression
a<=b?
Int i=1;
While(i<10){
If(i%2==0)
I++;}
2,4,6,8
25
X=x+3
63. In C/C++, which of the following data type is used to store real numbers?
Float
64. C/C++ has many libraries which contain variables and function names normally
starting with _________.
Underscore
66. Which of the following option gives the value stored at the address pointed to by the
pointer “ptr”?
*ptr
Istream or ostream
16
69. Automatic variables are created constantly and destroyed ________.
70. __________ are a conditional compilation process that is used to replace a piece of
code by its definition in a program
Macros
71. Calloc( ) functions allocates multiple blocks of memory and each block have
_______?
Same size
72. Which of the following header file deals with stream extraction?
Iostream.h
73. Trying to use getch( ) function without including #include<conio.h> header file in
the program is a _______ error
Compilition
No arguments
75. In C++ the name of the______ is the same as that of a class with a preceding tilde (~)
sign
76. Which of the following option returns the state of end of file?
Cin.eof();
77. If the memory In the free store is not sufficient enough to fulfill the request,
malloc() function returns ________.
NULL
Free store(heap)
79. When overloading assignment (=) operator which of the following syntax is correct?
***7
81. For overloading minus (.) operator which member operator function will be
correct?
new
83. The statement char arr[10] is an example of a type of _____ memory allocation
Static
84. Which of the following options not a source of the output stream?
#startif
What is operator
Keyboard
87. If(day==daysofMonth(*this))
{}
In above code *this refers to;
Current class
88. How many objects are initialized for the class data? Date mydates[10];
10
91. Representing logical depiction of the solution to the problem is known as a _______.
Structure
93. Which of the following options not a source of the output stream
screen