#include<stdio.h>
#include<conio.h>
#include<conio.h>
#include<stdlib.h>
void main ()
void main ()
{
int *a,i,n,item,found=0;
int *a,i,n,item,found=0;
printf("How many number: ");
scanf("%d", &n);
a=(int *)malloc(sizeof(int)*n);
for(i=0;i<n;i++)
scanf("%d",a+i);
printf("Enter any number to search: ");
scanf("%d", &item);
for(i=0;i<n;i++);
if(*(a+i)==item)
{
found=1;
break;
}
if(found==1)
printf("Found");
else
printf("Not found");
getch ();
}
}
No comments:
Post a Comment