Sunteți pe pagina 1din 3

1 Marks: 1 Which of the following operators have a lower precedence than the logical OR (|| ) operator?

Choose one answer. a. * b. None of the above c. > d. ^ 2 Marks: 1 Choose the incorrect statement. Choose one answer. a. An interpreter produces object code and saves it on disk. b. In the early days, people programmed computers in the machine code c. A compiler can convert source code to machine code d. An interpreter can convert source code to machine code 3 Marks: 1 What will be the output of the following program segment, if the value of number is 4? switch(number) { case 0 : printf("None "); break; case 1 : printf("One "); break; case 2 : printf("Two "); break; case 3 : case 4 : case 5 : printf("Many "); default : printf("Several "); }

Choose one answer. a. "Many " b. "Many Several " c. Nothing will be output d. "Several " 4 Marks: 1 Which one of the following statement on bit-wise logical operators is correct? Choose one answer. a. | (OR) has the highest precedence b. ^ (XOR) has the lowest precedence c. << has higher precedence than >> d. ~ (one's complement) has the highest precedence 5 Marks: 1 Identify the correct statement about IDE Choose one answer. a. None of the above b. IDE stands for Integrated Design Environment c. IDEs are used only with C and Java languages d. IDE is only used to compile the source code. 6 Marks: 1 Select the correct statement. Choose one answer. a. Literals are numbers, characters b. Character literals appear within c. In C language 'String' is a data d. Characters can represent integer

and operators. a pair of double quotation marks. type values

7 Marks: 1 What would NOT be a step in program (software) development? Choose one answer. a. Test the algorithm for correctness b. Show the algorithm to the user c. Document and maintain the program d. Outline the solution 8 Marks: 1 The following program does not compile. Identify the line(s) that contain error( s). 1. #include <stdio.h> 2. int main() 3. { 4. int i=0,j; 5. for(; i<=7; i++) //outer loop 6. { 7. for(j=0; ; j++) // inner loop 8. { 9. if (j => 11) 10. 11. break; 12. 13. printf("$"); 14. } // end of inner loop

15. 16. 17. 18.

printf(" "); } //end of outer loop return 0; }

Choose one answer. a. 7 b. 5 and 7 c. 9 d. 5 9 Marks: 1 Which one of the following statements on relational and logical operators is cor rect? Choose one answer. a. && has the lowest precedence among relational and logical operators b. > has higher precedence than >= c. != has higher precedence than = = d. ! has the highest precedence 10 Marks: 1 The command "ls -t" in the linux shell dispalys Choose one answer. a. Files in the current directory sorted according b. Files in the current directory sorted according c. Files in the current directory sorted according d. Files in the current directory sorted according Time Remaining You are logged in as (Logout)

to to to to

the most recent last size the most recent first the alphabetical order

S-ar putea să vă placă și