logo

CuriousTab

CuriousTab

Discussion


Home C Programming Functions See What Others Are Saying!
  • 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.

    More questions

    • 1. Which of the following function is more appropriate for reading in a multi-word string?

    • Options
    • A. printf();
    • B. scanf();
    • C. gets();
    • D. puts();
    • Discuss
    • 2. What will be the output of the program if the array begins at address 65486?
      #include<stdio.h>
      
      int main()
      {
          int arr[] = {12, 14, 15, 23, 45};
          printf("%u, %u\n", arr, &arr);
          return 0;
      }
      

    • Options
    • A. 65486, 65488
    • B. 65486, 65486
    • C. 65486, 65490
    • D. 65486, 65487
    • Discuss
    • 3. What will be the output of the program in Turbo C (under DOS)?
      #include<stdio.h>
      
      int main()
      {
          struct emp
          {
              char *n;
              int age;
          };
          struct emp e1 = {"Dravid", 23};
          struct emp e2 = e1;
          strupr(e2.n);
          printf("%s\n", e1.n);
          return 0;
      }
      

    • Options
    • A. Error: Invalid structure assignment
    • B. DRAVID
    • C. Dravid
    • D. No output
    • Discuss
    • 4. Does there any function exist to convert the int or float to a string?

    • Options
    • A. Yes
    • B. No
    • Discuss
    • 5. Which of the following special symbol allowed in a variable name?

    • Options
    • A. * (asterisk)
    • B. | (pipeline)
    • C. - (hyphen)
    • D. _ (underscore)
    • Discuss
    • 6. What will be the output of the program?
      #include<stdio.h>
      typedef unsigned long int uli;
      typedef uli u;
      
      int main()
      {
          uli a;
          u b = -1;
          a = -1;
          printf("%lu, %lu", a, b);
          return 0;
      }
      

    • Options
    • A. 4343445454, 4343445454
    • B. 4545455434, 4545455434
    • C. 4294967295, 4294967295
    • D. Garbage values
    • Discuss
    • 7. Which of the following statements are correct about the program?
      #include<stdio.h>
      int main()
      {
          int x = 30, y = 40;
          if(x == y)
              printf("x is equal to y\n");
      
          else if(x > y)
              printf("x is greater than y\n");
      
          else if(x < y)
              printf("x is less than y\n")
          return 0;
      }
      

    • Options
    • A. Error: Statement missing
    • B. Error: Expression syntax
    • C. Error: Lvalue required
    • D. Error: Rvalue required
    • Discuss
    • 8. What will be the output of the program?
      #define P printf("%d\n", -1^~0);
      #define M(P) int main()\
                   {\
                      P\
                      return 0;\
                   }
      M(P)
      

    • Options
    • A. 1
    • B. 0
    • C. -1
    • D. 2
    • Discuss
    • 9. Can the fixed arguments passed to the function that accepts variable argument list, occur at the end?

    • 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