Basic Programming language Interview Question
Categories: PROGRAMMING LANGUAGE
Ques. What Do You Mean by Reserved Words? Ans. A reserved word is a word in a programming language that has a fixed meaning and cannot be redefined by the programmer. It may look like a “normal” word, but it cannot be used as an identifier, such as the name of a variable, function, file name, command, or label. For example, “print” is a reserved word because it is a function in many languages to show text on the screen. Ques. Explain the Concept of Loops. Ans. A loop is a sequence of instructions that are repeated until a certain condition is reached. In a loop structure, the loop asks a question (i.e. has X variable reached a value of 5?). If the answer is no, an action is executed. The question is asked again and again until no further action is required. A loop prevents programmers from having to write the same line of code over and over. Ques. Tell Us About the Various Types of Loops. Ans. There are various types of loops that can be used in high-level programming languages, such as C, C++, and C#. Ques. How Do You Use FOR….NEXT Loop? Ans. Ans. The FOR…NEXT loop works by running the loop a specified number of times. For example, if you ask a computer to add the integers 1-10, it would add the first two numbers, followed by a third, a fourth, and so on, until it reaches the 10th iteration. Ques. How Do You Use WHILE….WEND Loop? Ans. In a While…Wend loop, if the condition is true, all the statements are executed until the Wend keyword is encountered. If the condition is false, the loop is exited and the control jumps to the very next statement after the Wend keyword. Ques. How Do You Use the Nested Loop? Ans. You can nest loops by putting one loop within another. The first pass of the outer loop triggers the inner loop, which executes to completion. The second pass of the outer loop triggers the inner loop again. This process repeats until the outer loop finishes. Ques. What Do You Mean by Documentation? Ans. Documentation is the explanation of how to use and operate a piece of software. This includes information on requirements, architecture/design, technical specifications as well as instruction manuals for the end-user, system administrator, and support staff. Documentation includes requirements documents, user documentation, system documentation, process documentation, and product documentation. Ques. What Do We Call the Binary Form of a Target Language? Ans. The binary form of a target language is also called binary code. Ques. Explain Constants. Ans. Constants are data values that stay constant every time a program is executed. Literal constants are actual values fixed into the source code. “Named” constants are constants that have been associated with an identifier, where the constant is known by its name instead of the literal constant. Ques. What Are the Two Types of Constants? Ans. 1. Numeric Constants A numeric constant consists of numerals, an optional leading sign, and an optional decimal point. Examples of valid numerical constants include 2.3, -4, and 6. 2. String Constants A string constant consists of a sequence of characters enclosed in double-quotes. It may consist of any combination of digits, letters, escaped sequences, and spaces. Ques. Explain Numeric Constants. Ans. There are two types of numeric constants: integer constants and real constants. Integer constants do not have a decimal point. They can be written using decimal numbers (base 10), octal numbers (base 8), or hexadecimal numbers (Base 16) that represent an integral value. A real constant is a constant that has a decimal point. They can be written in either fractional or exponential form. Ques. Explain String Constants. Ans. A string constant—also known as a string literal—is an arbitrary sequence of characters enclosed in double quotation marks. Ques. What Do You Mean by Operators? Ans. Operators are the backbone of every software application. An operator is a symbol that represents an action or process. This symbol tells the compiler to perform specific arithmetic or relational operations, such as adding or subtracting two numbers, to produce a final result. Ques. Define an Array. Ans. An array is a series of “boxes” or memory locations that hold a single item of data. However, each box shares the same name. All data in an array must be the same data type.