PRF 192 final2, Top Exam Questions and answers, Graded A+
PRF 192 final2, Top Exam Questions and answers, Graded A+ 1. int arr[]= {0, 2 , 0, 6) printf("%d", *arr); a) 0 b) c) NULL d) error - -answer: a 2. a = 1; b = 7; if(a || b++) b++; printf("%d", b); a) 7 b) 1 c) 8 d) 9 - -answer: c 3.What is the output when the sample code below is executed? char mess[] = "abc"; char* ptr; ptr = mess + strlen(mess); while(ptr mess) printf("%s", --ptr); a) abcd b) error c) cbcabc d) abcabc - -answer: c 4. #include stdio.h int main() { float x = 'a'; printf("%f", x); return 0; } a) a b) run time error c) a. d) 97. - -answer: d 5. Hàm nào sau đây nhận giá trị từ bàn phím a) getch(), getchar(), scanf() b) getchar(), scanf() c) kbhit(), getch(), scanf(), getchar() d) Tất cả đều sai - -answer: c 6. Why hexdecimal and octal representations are used for sets of bits? a) Because these representations are considerably shorter and more convenient b) Because they are larger than bit unit c) Because modern computers process and store information in hexadecimal and octal digits - -answer A 7. Which is NOT a valid data type in C language? a) int b) float c) string d) double - -answer: c 8. What is required to avoid falling through from one case to the next in the switch case? a) end; b) break;
Document information
- Uploaded on
- August 12, 2023
- Number of pages
- 9
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers