Why this C Language programme returning nothing ? | SoloLearn: Learn to code for FREE!

0

Why this C Language programme returning nothing ?

#include <stdio.h> #include <stdlib.h> int findElement() { int a[]={4,7,5,12,18,11}; int key=4; int i; for( i=0;i<6;i++) { if(a[i]==key) { return 1; } } return -1; } void main () { findElement(); }

c

5/12/2020 3:31:38 PM

rajendra

2 Answers

New Answer

+2

rajendra because you are not printing anything. Do this. int a = findElement(); printf("%d", a); Second this main should be return something so it will be int main()