Functions

Q1: 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)

ANS:B - Add prototype: float f(int, float)

The correct form of function f prototype is float f(int, float);



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.