C Functions Questions and Answers

Practice Mode
Showing 10 of 151 questions
Q1
The keyword used to transfer control from a function back to the calling function is
  • A switch
  • B goto
  • C go back
  • D return
Answer: Option D
Q2
What is the notation for following functions? int f(int a, float b)     {         /* Some code */     }  int f(a, b)     int a; float b;     {         /* Some code */     }
  • A 1. KR Notation 2. ANSI Notation
  • B 1. Pre ANSI C Notation 2. KR Notation
  • C 1. ANSI Notation 2. KR Notation
  • D 1. ANSI Notation 2. Pre ANSI Notation
Answer: Option C
Q3
How many times the program will print "IndiaBIX" ? #include<stdio.h> int main() {     printf("IndiaBIX");     main();     return 0; }
  • A Infinite times
  • B 32767 times
  • C 65535 times
  • D Till stack doesn't overflow
Answer: Option D
Q4
The program execution starts from
  • A the function which is first defined
  • B main ( ) function
  • C the function which is last defined
  • D the function other than main ( )
Answer: Option B
Q5
How many main ( ) functions can be defined in a C program ?
  • A 1
  • B 2
  • C 3
  • D any number of times
Answer: Option A
Q6
A function is identified by an open arenthesis following
  • A a keyword
  • B an identifier other than keywords
  • C an identifier including keywords
  • D an operator
Answer: Option B
Q7
A function with no action
  • A is an invalid function
  • B produces syntax error
  • C is allowed and is known as dummy function
  • D returns zero
Answer: Option C
Q8
Parameters are used
  • A to return values from the called function
  • B to spend values from the calling function
  • C options a and b
  • D to specify the data type of the return value
Answer: Option C
Q9
Identify the correct statement.
  • A A function can be defined more than once in a program
  • B Function definition cannot appear in any order.
  • C Functions cannot be distributed in many files.
  • D One function cannot be defined within another function definition .
Answer: Option D
Q10
The default return data type in function definition is
  • A void
  • B int
  • C float
  • D char
Answer: Option B
Questions and Answers for Competitive Exams Various Entrance Test