aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • Test 1 - Programming and Data Structure | Computer Science
  • Consider the C program shown below. ```c #include < st...
Multiple choice

Consider the C program shown below.

#include < stdio.h > 
#define print(x) print f(” % d“, x)
int x;
void Q(int z) {
  z + = x;
  print(z);
}
void P(int * y) {
  int x = * y + 2;
  Q(x); * y = x - 1;
  Print(x);
}
Main(void) {
  x = 5;
  P( & x)
  Print(x);
}

The output of this program is

  1. 12 7 6

  2. 22 12 11

  3. 14 6 6

  4. 7 6 6

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Keep practicing — related questions

  • Consider the C program shown below. \#include <stdio.h> \#define print(x) print f(”%d “, x) int x; void Q(i...
  • What does the following program print? #include void f (int *p, int * g) { p = q; * p = 2; } int i = 0, j =...
  • Consider the program below: #include int fun(int n, int *f_p) { int t, f; if (n <= 1) { *f_p = 1; return 1;...
  • #include void main() { int i=1; printf("%d",++i); printf("%d",i++); } choose output of the above program
  • What is the value printed by the following C program? #include int f(int * a, int n) { if (n <= 0) return 0...
  • What is printed by the following C program? int f(int x, int *py, int **ppz) void main() { { Int y, z; int ...
  • What is printed by the following C program? int f(int x, int py, int **ppz) void main() { { Int y, z; int c...
  • The following program prints main() { int i = 5; i = (++i) / (i ++); printf(“%d”,i); }
Play the full quiz 🎤 Practise this topic out loud
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy