logo

CuriousTab

CuriousTab

Discussion


Home C Programming Functions Comments

  • Question
  • Functions cannot return more than one value at a time


  • Options
  • A. True
  • B. False

  • Correct Answer
  • True 

    Explanation
    True, A function cannot return more than one value at a time. because after returning a value the control is given back to calling function.

    Functions problems


    Search Results


    • 1. In C all functions except main() can be called recursively.

    • Options
    • A. True
    • B. False
    • Discuss
    • 2. 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
    • 3. What will be the output of the program?
      #include<stdio.h>
      int check(int);
      int main()
      {
          int i=45, c;
          c = check(i);
          printf("%d\n", c);
          return 0;
      }
      int check(int ch)
      {
          if(ch >= 45)
              return 100;
          else
              return 10;
      }
      

    • Options
    • A. 100
    • B. 10
    • C. 1
    • D. 0
    • Discuss
    • 4. What will be the output of the program?
      #include<stdio.h>
      int check (int, int);
      
      int main()
      {
          int c;
          c = check(10, 20);
          printf("c=%d\n", c);
          return 0;
      }
      int check(int i, int j)
      {
          int *p, *q;
          p=&i;
          q=&j;
          i>=45? return(*p): return(*q);
      }
      

    • Options
    • A. Print 10
    • B. Print 20
    • C. Print 1
    • D. Compile error
    • Discuss
    • 5. What will be the output of the program?
      #include<stdio.h>
      void fun(int);
      typedef int (*pf) (int, int);
      int proc(pf, int, int);
      
      int main()
      {
          int a=3;
          fun(a);
          return 0;
      }
      void fun(int n)
      {
          if(n > 0)
          {
              fun(--n);
              printf("%d,", n);
              fun(--n);
          }
      }
      

    • Options
    • A. 0, 2, 1, 0,
    • B. 1, 1, 2, 0,
    • C. 0, 1, 0, 2,
    • D. 0, 1, 2, 0,
    • Discuss
    • 6. A function cannot be defined inside another function

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

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

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

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

    • Options
    • A. True
    • B. False
    • Discuss


    Comments

    There are no comments.

Enter a new Comment