Skip to main content
C Bug Hunt Easy +10 XP

Missing Return Type

This function declaration is incomplete.

CFind the bug
1add(int a, int b) {
2 return a + b;
3}
The bug is on line 1

Select the correct fix

Show answer and explanation

Answer: Add int return type

In C, every function must have an explicit return type. Without int, this is invalid in modern C.

Hint: C functions need a return type.

What this challenge tests

Bug Hunt in C: functions, return-type.

Related challenges