adplus-dvertising
frame-decoration

Question

There is a error in the below program. Which statement will you add to remove it?
#include<stdio.h>

int main()
{
    int a;
    a = f(10, 3.14);
    printf("%d\n", a);
    return 0;
}
float f(int aa, float bb)
{
    return ((float)aa + bb);
}

a.

Add prototype: float f(aa, bb)

b.

Add prototype: float f(int, float)

c.

Add prototype: float f(float, int)

d.

Add prototype: float f(bb, aa)

Posted under C Programming

Answer: (b).Add prototype: float f(int, float)

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. There is a error in the below program. Which statement will you add to remove it?

Similar Questions

Discover Related MCQs

Q. What is the notation for following functions?
1. int f(int a, float b)
{
/* Some code */
}

2. int f(a, b)
int a; float b;
{
/* Some code */
}

Q. In the following 'C' code, in which order the functions would be called ?

a = ( f1(23,14 ) * f2 (12/14)) + f3 () ;

Q. The function that actually created from a call to a template function is called

Q. A function that is prototype as

int calculate(int num);

may

Q. A function that uses variable types is called

Q. A function that is prototyped as double calculate (int, num);
may

Q. The declaration

void function1(int)

indicates the function1 is a function which

Q. The function fprintf is used in a program

Q. The function is lower(char) checks whether a character is in lower case or not, therefore it should return

Q. If max is a function that returns the larger of the two integers, given as arguments, then which of the following statements finds the largest of three given numbers

Q. A function can make

Q. Let a, b be two non-negative integers. Which of the following calls, finds the positive difference of a and b ?

Q. Pick the correct statements

Q. max is a function that returns the larger of the two integers, given as arguments. Which of the following statements finds the largest of three given numbers?

Q. Forward declaration is absolutely necessary

Q. void can be used

Q. Feature for accessing a variable through its address is desireable because

Q. It is not advisable to use macros instead of functions because

Q. Which of the following is/are syntactically correct?

Q. Use of macro instead of function is recommended