#include<stdio.h>
void main()
{
int i,n,a[10],b,s=0;
printf("\nEnter the number of element:");
scanf("%d",&n);
printf("\nEnter the List of Element:\n\n");
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
printf("\nEnter the element to be searched:");
scanf("%d",&b);
for(i=0;i<n;i++)
{
if(a[i]==b)
{
s=1;
break;
}
}
if(s==1)
{
printf("\nThe Element %d is Found in the index %d",b,++i);
}
else
{
printf("\nSorry...The Element %d is not Found",b);
}
}
void main()
{
int i,n,a[10],b,s=0;
printf("\nEnter the number of element:");
scanf("%d",&n);
printf("\nEnter the List of Element:\n\n");
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
printf("\nEnter the element to be searched:");
scanf("%d",&b);
for(i=0;i<n;i++)
{
if(a[i]==b)
{
s=1;
break;
}
}
if(s==1)
{
printf("\nThe Element %d is Found in the index %d",b,++i);
}
else
{
printf("\nSorry...The Element %d is not Found",b);
}
}
No comments:
Post a Comment
Thank you for using this blog.