Q. What is the default return value of a C function if not specified explicitly.?

  • (A) -1
  • (B) 0
  • (C) 1
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (C) 1

Q. What do you call this C Function calling itself.?

Code:
int funny2()
{
    funny2(num);
}
  • (A) Indefinite Function
  • (B) Definite Function
  • (C) Cursive Function
  • (D) Recursive Function
πŸ’¬ Discuss
βœ… Correct Answer: (D) Recursive Function

Q. What is the output of C Program with functions?

Code:
int bunny(int,int);
int main()
{
    int a, b;
    a = bunny(5, 10);
    b = bunny(10, 5);
    printf("%d %d", a, b);
    return 0;
}
int bunny(int i, int j)
{
    return (i, j);
}
  • (A) 5 10
  • (B) 10 5
  • (C) 5 5
  • (D) Compiler error
πŸ’¬ Discuss
βœ… Correct Answer: (B) 10 5

Q. What are the data type of variables that can be returned by a C Function.?

  • (A) int, float, double, char
  • (B) struct, enum
  • (C) Pointers to variables, arrays, functions, struct variables, enum variables etc
  • (D) All of the above
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of the above

Q. What is the output of a C Program with functions and pointers.?

Code:
void texas(int *,int *);
int main()
{
    int a=11, b=22;
    printf("Before=%d %d, ", a, b);
    texas(&a, &b);
    printf("After=%d %d", a, b);
    
    return 0;
}
void texas(int *i, int *j)
{
    *i = 55;
    *j = 65;
}
  • (A) Before=11 22, After=11 22
  • (B) Before=11 22, After=55 65
  • (C) Before=11 22, After=0 0
  • (D) Compiler error
πŸ’¬ Discuss
βœ… Correct Answer: (B) Before=11 22, After=55 65

Q. What is the output of C Program with pointers.?

Code:
int main()
{
    int a = 4;
    int *p;
    p=&a;
    while(*p > 0)
    {
        printf("%d ", *p);
        (*p)--;
    }
    return 0;
}
  • (A) 0 0 0 0
  • (B) 4 4 4 4
  • (C) 4 3 2 1
  • (D) Compiler error
πŸ’¬ Discuss
βœ… Correct Answer: (C) 4 3 2 1

Q. What is the output of C Program with functions?

Code:
void show();
int show();
int main()
{
    printf("ANT\n");
    return 0;
}
void show()
{
     printf("Integer") ;
}
int show()
{
    printf("Void");
}
  • (A) ANT
  • (B) Integer
  • (C) Void
  • (D) Compiler error
πŸ’¬ Discuss
βœ… Correct Answer: (D) Compiler error

Q. What is the output of C Program with functions?

Code:
void show(int);
void show(float);
int main()
{
    printf("ANT\n");
    return 0;
}
void show(int a)
{
     printf("Integer") ;
}
void show(float b)
{
    printf("Void");
}
  • (A) Integer Void
  • (B) ANT Integer Void
  • (C) ANT
  • (D) Compiler error
πŸ’¬ Discuss
βœ… Correct Answer: (D) Compiler error

Q. What is the output of C Program with pointers?

Code:
int main()
{
    int a=10;
    int *p, **q;
    p=&a;
    q=&p;
    printf("%d ", a);
    *p=15;
    printf("%d ", a);
    **q=20;
    printf("%d ", a);
    return 0;
}
  • (A) 10 10 10
  • (B) 10 0 0
  • (C) 10 15 20
  • (D) Compiler error
πŸ’¬ Discuss
βœ… Correct Answer: (C) 10 15 20

Q. What is the output of C Program with pointers?

Code:
int main()
{
    int a=20;
    int *p, *q;
    p=&a;
    q=p;
    printf("%d ", a);
    *p=30;
    printf("%d ", a);
    *q=40;
    printf("%d ", a);
    return 0;
}
  • (A) 20 0 0
  • (B) 20 20 20
  • (C) 20 30 40
  • (D) Compiler error
πŸ’¬ Discuss
βœ… Correct Answer: (C) 20 30 40