logo

CuriousTab

CuriousTab

Discussion


Home C Programming Declarations and Initializations See What Others Are Saying!
  • Question
  • When we mention the prototype of a function?


  • Options
  • A. Defining
  • B. Declaring
  • C. Prototyping
  • D. Calling

  • Correct Answer
  • Declaring 

    Explanation
    A function prototype in C or C++ is a declaration of a function that omits the function body but does specify the function's name, argument types and return type.

    While a function definition specifies what a function does, a function prototype can be thought of as specifying its interface.


    More questions

    • 1. Declare the following statement?
      "A pointer to an array of three chars".

    • Options
    • A.
      char *ptr[3]();
    • B.
      char (*ptr)*[3];
    • C.
      char (*ptr[3])();
    • D.
      char (*ptr)[3];
    • Discuss
    • 2. What will be the output of the program?
      #include<stdio.h>
      
      int main()
      {
          unsigned int res;
          res = (64 >>(2+1-2)) & (~(1<<2));
          printf("%d\n", res);
          return 0;
      }
      

    • Options
    • A. 32
    • B. 64
    • C. 0
    • D. 128
    • Discuss
    • 3. Union elements can be of different sizes.

    • Options
    • A. True
    • B. False
    • Discuss
    • 4. What will be the output of the program in DOS (Compiler - Turbo C)?
      #include<stdio.h>
      double i;
      
      int main()
      {
          (int)(float)(char) i;
          printf("%d",sizeof(i));
          return 0;
      }
      

    • Options
    • A. 4
    • B. 8
    • C. 16
    • D. 22
    • Discuss
    • 5. size of union is size of the longest element in the union

    • Options
    • A. Yes
    • B. No
    • Discuss
    • 6. Bitwise & can be used to divide a number by powers of 2

    • Options
    • A. True
    • B. False
    • Discuss
    • 7. Assuming, integer is 2 byte, What will be the output of the program?
      #include;
      
      int main()
      {
          printf("%x\n", -1>>1);
          return 0;
      }
      

    • Options
    • A. ffff
    • B. 0fff
    • C. 0000
    • D. fff0
    • Discuss
    • 8. What is the output of the program given below?
      #include<stdio.h>
      int main()
      {
          enum status { pass, fail, atkt};
          enum status stud1, stud2, stud3;
          stud1 = pass;
          stud2 = atkt;
          stud3 = fail;
          printf("%d, %d, %d\n", stud1, stud2, stud3);
          return 0;
      }
      

    • Options
    • A. 0, 1, 2
    • B. 1, 2, 3
    • C. 0, 2, 1
    • D. 1, 3, 2
    • Discuss
    • 9. What will be the output of the program?
      #include<stdio.h>
      int main()
      {
          char ch;
          ch = 'A';
          printf("The letter is");
          printf("%c", ch >= 'A' && ch <= 'Z'? ch + 'a' - 'A':ch);
          printf("Now the letter is");
          printf("%c\n", ch >= 'A' && ch <= 'Z'? ch : ch + 'a' - 'A');
          return 0;
      }
      

    • Options
    • A. The letter is a
      Now the letter is A
    • B. The letter is A
      Now the letter is a
    • C. Error
    • D. None of above
    • Discuss
    • 10. What will be the output of the program?
      #include<stdio.h>
      int main()
      {
          int k, num=30;
          k = (num>5? (num <=10? 100 : 200): 500);
          printf("%d\n", num);
          return 0;
      }
      

    • Options
    • A. 200
    • B. 30
    • C. 100
    • D. 500
    • Discuss


    Comments

    There are no comments.

Enter a new Comment