logo

CuriousTab

CuriousTab

Discussion


Home C Programming Functions Comments

  • Question
  • A function may have any number of return statements each returning different values.


  • Options
  • A. True
  • B. False

  • Correct Answer
  • True 

    Explanation
    True, A function may have any number of return statements each returning different values and each return statements will not occur successively.

    Functions problems


    Search Results


    • 1. If return type for a function is not specified, it defaults to int

    • Options
    • A. True
    • B. False
    • Discuss
    • 2. A function cannot be defined inside another function

    • Options
    • A. True
    • B. False
    • Discuss
    • 3. Functions cannot return more than one value at a time

    • Options
    • A. True
    • B. False
    • Discuss
    • 4. In C all functions except main() can be called recursively.

    • Options
    • A. True
    • B. False
    • Discuss
    • 5. What will be the output of the program?
      #include<stdio.h>
      #include<stdlib.h>
      
      int main()
      {
          int i=0;
          i++;
          if(i<=5)
          {
              printf("CuriousTab");
              exit(1);
              main();
          }
          return 0;
      }
      

    • Options
    • A. Prints "CuriousTab" 5 times
    • B. Function main() doesn't calls itself
    • C. Infinite loop
    • D. Prints "CuriousTab"
    • Discuss
    • 6. Functions can be called either by value or reference

    • Options
    • A. True
    • B. False
    • Discuss
    • 7. Names of functions in two different files linked together must be unique

    • Options
    • A. True
    • B. False
    • Discuss
    • 8. If a function contains two return statements successively, the compiler will generate warnings. Yes/No?

    • Options
    • A. Yes
    • B. No
    • Discuss
    • 9. Functions cannot return a floating point number

    • Options
    • A. Yes
    • B. No
    • Discuss
    • 10. Maximum number of arguments that a function can take is 12

    • Options
    • A. Yes
    • B. No
    • Discuss


    Comments

    There are no comments.

Enter a new Comment