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(); }
2 Réponses
+ 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()