Computer Programming for Engineers (Practice Test MCQs)

50 Score: 0 Attempted: 0/50 Subscribe
1. Which of the following is a high-level programming language?





2. The process of finding and correcting errors in a program is called:





3. In C programming, which symbol is used to terminate a statement?





4. A variable declared inside a function is called:





5. Which operator is used to compare two values in most programming languages?




7. Which of the following is a loop structure in C/C++?





8. What is the output of printf(“%d”, 5 + 3); in C?





9. The keyword used to define a constant in C is:





10. Which data type is used to store a single character in C?





11. Which of the following is an example of a conditional statement?





12. What does the break statement do in loops?





13. An array in C starts with index:





14. Which of the following is used for dynamic memory allocation in C?





15. The return statement is used in a function to:





16. Which symbol is used to denote comments in C++ (single line)?




17. A function that calls itself is known as:





18. The default value of an uninitialized variable in C is:





19. The main function in C/C++ is:





20. Which header file is required for printf() function?





21. In object-oriented programming, encapsulation means:





22. Which operator is used to access members of a structure in C?





23. Which of the following is a logical operator?





24. The term float represents:





25. Which of these is not a programming language?





26. The sizeof() operator in C is used to:





27. The process of converting source code into machine code is called:





28. The extension of a C program file is:





29. Which keyword is used to define a class in C++?





30. What is the purpose of a constructor in C++?





31. Which of the following is not a loop structure?





32. The keyword void indicates:





33. The file handling function used to open a file in C is:





34. What is the output of: printf("%c", 65); ?





35. A pointer in C stores:





36. In C++, which operator is overloaded for object comparison?





37. Which function is used to read a string in C?





38. What is the main advantage of using functions in programming?





39. In C, int x = 5/2; will store:





40. Which of the following is a valid variable name?





41. The keyword new in C++ is used to:





42. Which loop executes at least once, even if the condition is false?





43. A string in C is:





44. The ASCII code for '0' is:





45. Which keyword is used to handle exceptions in C++?





46. The process of calling a function within itself is called:





47. The operator used to access a pointer’s value is:





48. What is the size of int in most 32-bit systems?





49. Which function is used to close a file in C?





50. The modulus operator (%) gives:





1. Basic/Foundation Subjects

2. Core Civil Engineering Subjects

3. Advanced/Applied Subjects

4. Management and Planning

5. Environmental & Sustainable Development