logo

CuriousTab

CuriousTab

Functions problems


  • 1. 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
  • 2. In C all functions except main() can be called recursively.

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

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

  • Options
  • A. True
  • B. False
  • Discuss
  • 5. If return type for a function is not specified, it defaults to int

  • Options
  • A. True
  • B. False
  • Discuss
  • 6. A function may have any number of return statements each returning different values.

  • Options
  • A. True
  • B. False
  • Discuss
  • 7. Functions can be called either by value or reference

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

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

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

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

First 2 3 4