C- Functions Question and Answer

C- Functions Question and Answer
1. The keyword used to transfer control from a function back to the calling function is
  • switch
  • goto
  • go back
  • return
Show Answer
2. 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 */     }
  • 1. KR Notation 2. ANSI Notation
  • 1. Pre ANSI C Notation 2. KR Notation
  • 1. ANSI Notation 2. KR Notation
  • 1. ANSI Notation 2. Pre ANSI Notation
Show Answer
3. How many times the program will print "IndiaBIX" ?

#include<stdio.h>

int main()
{
    printf("IndiaBIX");
    main();
    return 0;
}

  • Infinite times
  • 32767 times
  • 65535 times
  • Till stack doesn't overflow
Show Answer
4. The program execution starts from
  • the function which is first defined
  • main ( ) function
  • the function which is last defined
  • the function other than main ( )
Show Answer
5. How many main ( ) functions can be defined in a C program ?
  • 1
  • 2
  • 3
  • any number of times
Show Answer
6. A function is identified by an open arenthesis following
  • a keyword
  • an identifier other than keywords
  • an identifier including keywords
  • an operator
Show Answer
7. A function with no action
  • is an invalid function
  • produces syntax error
  • is allowed and is known as dummy function
  • returns zero
Show Answer
8. Parameters are used
  • to return values from the called function
  • to spend values from the calling function
  • options a and b
  • to specify the data type of the return value
Show Answer
9. Identify the correct statement.
  • A function can be defined more than once in a program
  • Function definition cannot appear in any order.
  • Functions cannot be distributed in many files.
  • One function cannot be defined within another function definition .
Show Answer
10. The default return data type in function definition is
  • void
  • int
  • float
  • char
Show Answer
Questions and Answers for Competitive Exams Various Entrance Test