Tag: programming languages

Questions Related to programming languages

  1. Conditional Operator

  2. Bitwise Operators

  3. Logical operators

  4. Relational Operator


Correct Option: A
Explanation:

To solve this question, the user needs to have a basic understanding of the different types of operators used in programming languages.

The symbol "?" is known as the conditional operator.

Option A: Conditional Operator - This option is correct. The conditional operator, also known as the ternary operator, is represented by the symbol "?". It is a shorthand way of writing an if-else statement in a single line of code.

Option B: Bitwise Operators - This option is incorrect. Bitwise operators are used to perform operations on individual bits of a number. Examples include AND, OR, NOT, and XOR.

Option C: Logical Operators - This option is incorrect. Logical operators are used to combine multiple conditions. Examples include AND, OR, and NOT.

Option D: Relational Operator - This option is incorrect. Relational operators are used to compare two values. Examples include , <=, >=, ==, and !=.

Therefore, the answer is: A. Conditional Operator

  1. Data Type

  2. Abstract Type

  3. User Defined Type

  4. All of these options


Correct Option: C

UML stands for

  1. Unique modeling language.

  2. Unified modeling language

  3. Unified modern language

  4. Unified master laqnguage


Correct Option: B

This operator returns the size in bytes of that data type or object or structure etc

  1. Conditional Operator

  2. Bitwise Operators

  3. sizeof () operator

  4. Relational Operator


Correct Option: C

Encapsulation is the process of basing one class on another.

  1. True

  2. False


Correct Option: B

AI Explanation

To answer this question, you need to understand the concept of encapsulation.

Encapsulation is a fundamental principle of object-oriented programming (OOP) that involves bundling data and the methods that operate on that data within a single unit, known as a class. The purpose of encapsulation is to hide the internal details of the object and provide a public interface through which other objects can interact with it.

The statement "Encapsulation is the process of basing one class on another" is incorrect. Encapsulation is not about one class being based on another. It is about combining data and methods into a single unit (class) to achieve data hiding and abstraction.

Therefore, the correct answer is B) False.

#include main() { char a[4]="HELLO"; printf("%s",a); }

  1. O

  2. H

  3. HELLO

  4. Compilation Error


Correct Option: D

#include main() { int a[2][2][2] = {{10,2,3,4},{5,6,7,8}}; int p,*q; p=&a[2][2][2]; *q=**a printf("%d----%d",*p,*q); }

  1. Compilation error

  2. syntax error

  3. 10 2 3 4 5 6 7 8

  4. print the address of pointer p and q


Correct Option: A

#include main (){ unsigned int a = 0xf0ad; char *c = (char *) &a; printf("value @c: %x",*c); }

  1. value @c: ffffffad

  2. value @c: 0xf0ad

  3. compilation error

  4. syntax error


Correct Option: A