Q. What is the output of C Program with pointers?

Code:
int main()
{
    int a=20;
    //a memory location=1234
    printf("%d %d %d", a, &a, *(&a));
    return 0;
}
  • (A) 20 20 20
  • (B) 20 1234 1234
  • (C) 20 1234 20
  • (D) 20 20 20
πŸ’¬ Discuss
βœ… Correct Answer: (C) 20 1234 20

Q. What is the output of C Program with functions?

Code:
int main()
{
    int a=20;
    printf("CINEMA ");
    return 1;
    printf("DINOSAUR");
    return 1;
}
  • (A) CINEMA DINOSAUR
  • (B) CINEMA
  • (C) DINOSAUR
  • (D) Compiler error
πŸ’¬ Discuss
βœ… Correct Answer: (B) CINEMA

Q. What is the output of C Program with recursive function?

Code:
int sum(int);
int main()
{
    int b;
    b = sum(4);
    printf("%d", b);
    
}
int sum(int x)
{
    int k=1;
    if(x<=1)
     return 1;
    k = x + sum(x-1);
    return k;
}
  • (A) 10
  • (B) 11
  • (C) 12
  • (D) 13
πŸ’¬ Discuss
βœ… Correct Answer: (A) 10

Q. What is the output of C Program with Recursive Function?

Code:
int mul(int);
int main()
{
    int b;
    b = mul(3);
    printf("%d", b);
}
int mul(int x)
{
    if(x<=1)
     return 1;
    return (x * mul(x-1));
}
  • (A) 2
  • (B) 3
  • (C) 6
  • (D) 1
πŸ’¬ Discuss
βœ… Correct Answer: (C) 6

Q. A recursive function can be replaced with __ in c language.

  • (A) for loop
  • (B) while loop
  • (C) do while loop
  • (D) All of the above
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of the above

Q. A recursive function is faster than __ loop.

  • (A) for
  • (B) while
  • (C) do while
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (D) None of the above

Q. A recursive function without If and Else conditions will always lead to?

  • (A) Finite loop
  • (B) Infinite loop
  • (C) Incorrect result
  • (D) Correct result
πŸ’¬ Discuss
βœ… Correct Answer: (B) Infinite loop

Q. What is the C keyword that must be used to achieve expected result using Recursion?

  • (A) printf
  • (B) scanf
  • (C) void
  • (D) return
πŸ’¬ Discuss
βœ… Correct Answer: (D) return

Q. How many functions are required to create a recursive functionality?

  • (A) One
  • (B) Two
  • (C) More than two
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (A) One

Q. Choose a correct statement about Recursive Function in C language.

  • (A) Each recursion creates new variables at different memory locations
  • (B) There is no limit on the number of Recursive calls
  • (C) Pointers can also be used with Recursion but with difficulty.
  • (D) All of the above
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of the above