Civil Engineering Mechanical Engineering Chemical Engineering Networking Database Questions Computer Science Basic Electronics Digital Electronics Electronic Devices Circuit Simulation Electrical Enigneering Engineering Mechanics Technical Drawing

# C Programming - Functions

@ : Home > C Programming > Functions > Point Out Correct Statements

### Exercise

"Weakness of attitude becomes weakness of character."
- Albert Einstein
1.

Which of the following statements are correct about the program?

``````#include<stdio.h>

int main()
{
printf("%p\n", main());
return 0;
}
``````

 A. It prints garbage values infinitely B. Runs infinitely without printing anything C. Error: main() cannot be called inside printf() D. No Error and print nothing

2.

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)

3.

Which of the following statements are correct about the function?

``````long fun(int num)
{
int i;
long f=1;
for(i=1; i<=num; i++)
f = f * i;
return f;
}
``````

 A. The function calculates the value of 1 raised to power num. B. The function calculates the square root of an integer C. The function calculates the factorial value of an integer D. None of above