SHARE
TWEET

index of

AnnJ Nov 18th, 2016 583 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. #include<string.h>
  4.  
  5. char L[5]="abdba";
  6. int indexof(char x)
  7. {
  8.     int i;
  9.     for(i=0;i<5;i++)
  10.     {
  11.         if(x==L[i]){
  12.  
  13.             return i;
  14.         }
  15.  
  16.  
  17.     }
  18.  
  19.     return -1;
  20.  
  21. }
  22. int main()
  23. {
  24.     printf("%d\n",indexof('d'));
  25.     printf("%d\n",indexof('a'));
  26.     printf("%d\n",indexof('z'));
  27. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top