Tag: programming languages

Questions Related to programming languages

What is the maximum length of command line arguments including space between adjacent arguments

  1. 100

  2. 50

  3. 200

  4. 150


Correct Option: C

void main() { int x=20,y=35; x= y++ + x++; y= ++y + ++x; printf(" %d %d" , x,y); }

  1. x=57 & y=94

  2. x=57,y=55

  3. X = 57 Y= 93

  4. X = 37 Y= 65


Correct Option: A

AI Explanation

To determine the values of x and y after executing the given code, let's go through each line of the code step by step:

  1. int x=20, y=35; - This line initializes the variables x and y with the values 20 and 35, respectively.
  2. x = y++ + x++; - This line assigns the value of y++ + x++ to x.
    • y++ is a post-increment operation, meaning that the value of y is used first and then incremented by 1. So, y++ evaluates to 35, and y becomes 36.
    • Similarly, x++ is a post-increment operation, so x++ evaluates to 20, and x becomes 21.
    • Therefore, x is assigned the value 35 + 20 = 55.
  3. y = ++y + ++x; - This line assigns the value of ++y + ++x to y.
    • ++y is a pre-increment operation, meaning that the value of y is incremented by 1 first and then used. So, ++y evaluates to 37, and y becomes 37.
    • Similarly, ++x is a pre-increment operation, so ++x evaluates to 22, and x becomes 22.
    • Therefore, y is assigned the value 37 + 22 = 59.
  4. printf(" %d %d", x, y); - This line prints the values of x and y.

Therefore, the output of the code will be 55 59.

The correct answer is not listed among the options provided.

  1. The Gang of Four

  2. The Party of Five

  3. The soft-drink industry

  4. AC/DC


Correct Option: A
  1. Don't link your modules to modules written in any other language

  2. Make sure you declare all your variables' data types ahead of time

  3. Don't add variables of one type to variables of another

  4. Devout prayer


Correct Option: D