the right answer. (45 marks I Choose 1. The C-preprocessors are specified with a
ID: 3909628 • Letter: T
Question
the right answer. (45 marks I Choose 1. The C-preprocessors are specified with a)# symbol. d) None of the mentioned b) $ 2. Which of the following is not a valid variable name declaration? a)int-a3; b) inta_3; c) int 3-a; d) int -3a 3. Which is correct with respect to size of the datatypes? a) char > int > float b) int > char float c)har int 4. Loss in precision occurs for typecasting from a). char to short b). float to double c).long to float d). double to int 5. %f access specifier is used for a). Strings b). Integral types c). Floating type d). All of the mentioned 6. What is the output of this C code? int c int a - 10; c a+ b; double b-5.6 printf("%d", c); ?). ?). 15 b). 16 15.6 d). 10 7. Which is the best way to generate numbers between 0 to 99 a) rand()/ 100 b) rand() % 100 c) rand(100) d) srand(10o) 8. A pointer is a) A variable that stores address of other variable c) A variable that stores address of an instruction b) A keyword used to create variables d) All of the above 9. What is the output of this C code? int x - 8; printf("%d ", x); c)2 d) Depends on the compiler a)4 b) 16 10. What is the output of this C code? const double pi 3.14; printf("pi is %f", pi); b) Compile time error a) pi is 4 11. What is the output of this C code? c) pi is 3.14 d)pís followed by a garbage value int a -1, b 2; b)32 printf("%d %d", a, b); a) 12 d) 21Explanation / Answer
1). a (Ex: #define, #include etc..)
2). c (Variable name should not start with integer)
3). c
4). d (double is bigger than int)
5). c
6). a (As the variable c is of type int, the result will beccome of integer type)
7). b
8). a
9). b (01000 shifted to left side one becomes 10000, whose value is 16)
10). b (Compile time error because the varaible pi is read only)
11). c (a*=b+=a ==> a*=(b=b+a) ====> a*=(b=3) ====> a = a*3 ====> a=3, b=3)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.