Advertisement

Search Topics....

C & C++

Q. Which of the following special symbol allowed in a variable?

A. * (asterisk)
B. | (pipeline)
C. - (hyphen)
D. _ (underscore)


Q.How would you round off a value from 1.66 to 2.0?

A. ceil(1.66) 
B. floor(1.66)
C. roundup(1.66) 
D. roundto(1.66)


Q.Which of the definition is correct?

A. int length; 
B. char int;
C. int long; 
D. float double;

Q. What is the output of the program given below ?

#include
 int main() 
 enum status { pass, fail, atkt}; 
 enum status stud1, stud2, stud3; 
 stud1 = pass; 
 stud2 = atkt; stud3 = fail;
 printf("%d, %d, %d\n", stud1, stud2, stud3);
 return 0; 
}

A. 0, 1, 2
B. 1, 2, 3
C. 0, 2, 1 
D. 1, 3, 2

Q. C is a?

(a) 
high level language 
(b) low level language
(c) 
high level language with some low level features.
(d) low level language with some high level features.

Q. What will happen if in a C program you assign a value to an array element whose subscript exceeds the size of array?

(a. The element will be set to 0.
(b. 
The compiler would report an error.
(c. The program may crash if some important data gets overwritten.
(d. The array size would appropriately grow.

Q. Which of the following operations can be performed on the file "NOTES.TXT" using the below code? FILE *fp;
fp = fopen("NOTES.TXT", "r+");
(a. Reading
(b. Writing
(c. Appending 
(d,Read and Write 


Q. What is the correct value to return to the operating system upon the successful completion of a program?
A. -1
B. 1
C
. 0
D. Programs do not return a value.

Q. What is the only function all C++ programs must contain?
A. start()
B. system()
C. main()
D. program()

Q. What punctuation is used to signal the beginning and end of code blocks?A. { }
B. -> and <-
C. BEGIN and END
D. ( and )

Q. What punctuation ends most lines of C++ code?
A. . (dot)
B. ; (semi-colon)
C. : (colon)
D. ' (single quote)


Q. Which of the following is a correct comment?
A. */ Comments */
B. ** Comment **
C. /* Comment */
D. { Comment }


Q. Which of the following is not a correct variable type?A. float
B. real
C. int
D. double

Q. Which of the following is the correct operator to compare two variables?
A. :=
B. =
C. equal
D. = =

Q. Which of the following is true?
A. 1
B. 66
C. .1
D. All of the above
Q. Which of the following is the boolean operator for logical-and?
A. &
B. &&
C. |
D. |&


Q. Evaluate !(1 && !(0 || 1)).
A. True
B. False
C. Unevaluatable


Q. A self contained block of statements that perform a coherent task of some kind is called a (A) Monitor 
(B) Function
(C) Program 
(D) Structure


Q. Recursion is sometimes called
(A) Circular definition 
(B) Complex definition
(C) Procedure 
(D) Union


Q. Unsigned integer occupies
(A) Two bytes 
(B) Four bytes
(C) One byte 
(D) Eight bytes

Q. Each C preprocessor directive begins with
(A) # 
(B) include
(C) main()