what is the output of the following code snippet

C (Programming Language)

Q75. What is the output of the following code snippet?

int main() {
 
  int sum = 2 + 4 / 2 + 6 * 2;
 
  printf("%d", sum);
 
  return 0;
 
 }
  • 2
  • 15
  • 16
  • 18
what is the output of the following code snippet

linkedin assesment quizzes php

Q7. What is a key difference between GET and POST?

  • GET is used with the HTTP protocol. POST is used with HTTPS.
  • GET displays the submitted data as part of the URL. During POST, this information is not shown, as it’s encoded in the request body.
  • GET is intended for changing the server state and it carries more data than POST.
  • GET is more secure than POST and should be used for sensitive information.
what is the output of the following code snippet

linkedin assesment quizzes php

Q11. What is missing from this code, which is supposed to create a test cookies?

$string_name = "testcookie";
 $string_value = "This is a test cookie";
 $expiry_info = info()+259200;
 $string_domain = "localhost.localdomain";
  • The $_REQUEST is missing.
  • The $_COOKIES array is missing.
  • The cookie session is missing.
  • The call to setcookie() is missing.
what is the output of the following code snippet

linkedin assesment quizzes php

Q12. What is the value of $total in this calculation?

$total = 2 + 5 * 20 - 6 / 3

  • 44
  • 138
  • 126
  • 100
what is the output of the following code snippet

linkedin assesment quizzes php

Q13. What is the purpose of adding a lowercase “u” as a modifier after the final delimiter in a Perl-compatible regular expression?

  • It makes the dot metacharacter match anything, including newline characters.
  • It makes the pattern match uppercase letters.
  • Both the pattern and subject string are treated as UTF-8.
  • It inverts the greediness of the quantifiers in the pattern so they are not greedy by default.
what is the output of the following code snippet

linkedin assesment quizzes php

Q25. What is the significance of the three dots in this function signature?

function process(...$vals) {
  // do some processing
 }
  • It makes the function variadic, allowing it to accept as an argument an array containing an arbitrary number of values.
  • It makes the function variadic, allowing it to accept an arbitrary number of arguments that are converted into an array inside the function.
  • It temporarily disables the function while debugging other parts of the script.
  • It’s a placeholder like a TO DO reminder that automatically triggers a notice when you run a script before completing the function definition.