Computer Language Questions with Solutions
A computer language is a formal language used to write instructions for a computer. This topic covers the levels of programming languages: machine language (binary code the CPU runs directly), assembly language (which uses short mnemonics such as ADD and MOV), and high-level languages such as C, C++, Java and Python, which are closer to human language. It also covers language translators (assemblers, compilers and interpreters), generations of programming languages from 1GL to 5GL, programming paradigms (procedural, object-oriented, functional and logic programming), and basic concepts such as source code, object code, syntax errors and logical errors. Exam questions often ask which translator is used for which language level, which language is machine-dependent, and the main features of object-oriented programming (encapsulation, inheritance, polymorphism and abstraction). Practise the computer language questions below. Each answer includes an explanation.
- Q1.
In HTML,________ attribute specifies a set of controls that are linked so that only one radio button among each set is selected at a time.
A. TYPE="TEXT"B. TYPE="PASSWORD"C. TYPE="RADIO"D. TYPE="CHECKBOX"mediumAsked in TCS ExamView solution › - Q2.
A program written in machine language is called
A. AssemblerB. ObjectC. ComputerD. MachinemediumAsked in TCS ExamView solution › - Q3.
Given an unsigned 32-bit integer x, which of the following C/C++ expressions correctly toggles m bits starting from position p (with the least significant bit at position 0)?
A. x & ~(((1 << m) - 1) << p)B. x ^ ((1 << m) << p)C. x ^ (((1 << m) - 1) << p)D. x | ((1 << m) << p)mediumAsked in NIMCET 2025View solution › - Q4.
Match all items in Group 1 with the correct options from those given in Group 2.
A. P-4, Q-2, R-3, S-1B. P-2, Q-3, R-1, S-4C. P-1, Q-2, R-3, S-4D. P-2, Q-3, R-4, S-1mediumAsked in NIMCET 2025View solution ›