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

Code:
int show();

void main()
{
    int a;
    a=show();
    printf("%d", a);
}

int show()
{
    return 15.5;
    return 35;
}
  • (A) 15.5
  • (B) 15
  • (C) 0
  • (D) Compiler error
πŸ’¬ Discuss
βœ… Correct Answer: (B) 15

Q. What is the output of C Program?

Code:
int myshow(int);

void main()
{
   myshow(5);
   myshow(10);
}

int myshow(int b)
{
    printf("Received %d, ", b);
}
  • (A) Received 5, Received 10,
  • (B) Received 10, Received 5,
  • (C) Received 0, Received 0,
  • (D) Compiler error
πŸ’¬ Discuss
βœ… Correct Answer: (A) Received 5, Received 10,

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

Code:
int myshow(int);

void main()
{
   int a=10;
   myshow(a);
   myshow(&a);
}

int myshow(int b)
{
    printf("Received %d, ", b);
}
  • (A) Received 10, Received 10,
  • (B) Received 10, Received RANDOMNumber,
  • (C) Received 10, Received RANDOMNumber, with a compiler warning
  • (D) Compiler error
πŸ’¬ Discuss
βœ… Correct Answer: (C) Received 10, Received RANDOMNumber, with a compiler warning

Q. Choose correct statements about C Language Pass By Value.

  • (A) Pass By Value copies the variable value in one more memory location.
  • (B) Pass By Value does not use Pointers.
  • (C) Pass By Value protects your source or original variables from changes in outside functions or called functions.
  • (D) All of the above
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of the above

Q. What is the limit for number of functions in a C Program.?

  • (A) 16
  • (B) 31
  • (C) 32
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (D) None of the above

Q. Every C Program should contain which function?

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

Q. What is the minimum number of functions to be present in a C Program?

  • (A) 1
  • (B) 2
  • (C) 3
  • (D) 4
πŸ’¬ Discuss
βœ… Correct Answer: (A) 1

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

Code:
static void show();

int main()
{
    printf("ROCKET ");
    show();
    return 0;
}

static void show()
{
    printf("STATIC");
}
  • (A) ROCKET
  • (B) ROCKET STATIC
  • (C) STATIC ROCKET
  • (D) Compiler error
πŸ’¬ Discuss
βœ… Correct Answer: (B) ROCKET STATIC

Q. What is the maximum number of statements that can present in a C function?

  • (A) 64
  • (B) 128
  • (C) 256
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (D) None of the above

Q. What characters are allowed in a C function name identifier.?

  • (A) Alphabets, Numbers, %, $, _
  • (B) Alphabets, Numbers, Underscore ( _ )
  • (C) Alphabets, Numbers, dollar $
  • (D) Alphabets, Numbers, %
πŸ’¬ Discuss
βœ… Correct Answer: (B) Alphabets, Numbers, Underscore ( _ )