-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program15_3.c
55 lines (43 loc) · 882 Bytes
/
Program15_3.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include<stdio.h>
#include<stdlib.h>
#include<stdbool.h>
bool Check(int Arr[], int iSize)
{
int iCnt = 0;
for(iCnt = 0; iCnt<iSize; iCnt++)
{
if(Arr[iCnt] == 11)
{
return true;
}
else
{
return false;
}
}
}
int main()
{
int iLength = 0, i = 0;
bool bRet = false;
int *ptr = 0;
printf("Enter number of elements\n");
scanf("%d",&iLength);
ptr = (int *)malloc(iLength * sizeof(int));
printf("Enter numbers\n");
for(i = 0; i <iLength; i++)
{
scanf("%d",&ptr[i]);
}
bRet = Check(ptr, iLength);
if(bRet == true)
{
printf("11 is present in the array");
}
else
{
printf("11 is not present in the array");
}
free(ptr);
return 0;
}