# include <stdio.h>
# include <conio.h>
int main()
{
int x,list[10],i,n,p;
printf("enter the size of list\n");
scanf("%d",n);//save list number in varable n
printf("enter the number of elementry\n");
for(i=0;i<n;i++)//intialize the element in for looping
scanf("%d",list[i]);//save number in array list[i]
p=0;
printf("enter the element");
scanf("%d",x);
for(i=0;i<n;i++)//check search number and show help for looping
{
if(list[i]==x)//checkgiven number for array index
p=i;
}
if(p=0)//if number given then number adress print
printf("show the element address %d is %d\n",x,p);
else //if no not search then try again
printf("try again");
getch();//prog processing end then back main screen
return 0;
}
OUTPUT
enter the size of list
5
enter the number of element
2
5
4
3
6
show the element adress
4 is 2
# include <conio.h>
int main()
{
int x,list[10],i,n,p;
printf("enter the size of list\n");
scanf("%d",n);//save list number in varable n
printf("enter the number of elementry\n");
for(i=0;i<n;i++)//intialize the element in for looping
scanf("%d",list[i]);//save number in array list[i]
p=0;
printf("enter the element");
scanf("%d",x);
for(i=0;i<n;i++)//check search number and show help for looping
{
if(list[i]==x)//checkgiven number for array index
p=i;
}
if(p=0)//if number given then number adress print
printf("show the element address %d is %d\n",x,p);
else //if no not search then try again
printf("try again");
getch();//prog processing end then back main screen
return 0;
}
OUTPUT
enter the size of list
5
enter the number of element
2
5
4
3
6
show the element adress
4 is 2
No comments:
Post a Comment
Note: only a member of this blog may post a comment.