Advertisement
Guest User

Untitled

a guest
Sep 15th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4. int n,i,pos=0,num[5]={1,2,3,40,5};
  5. scanf("%d",&n);
  6. for(i=0;i<5;i++)
  7. {
  8. if(n==num[i])
  9. {
  10. pos=i+1;
  11. break;
  12. }
  13. }
  14. if(pos==0)
  15. printf("The number is not found");
  16. else
  17. {
  18. printf("The number %d is found and the number position is %d\n",num[i],pos);
  19.  
  20. }
  21.  
  22. return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement