Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- int n,i,pos=0,num[5]={1,2,3,40,5};
- scanf("%d",&n);
- for(i=0;i<5;i++)
- {
- if(n==num[i])
- {
- pos=i+1;
- break;
- }
- }
- if(pos==0)
- printf("The number is not found");
- else
- {
- printf("The number %d is found and the number position is %d\n",num[i],pos);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement