Advertisement
sahar1234tt

Untitled

Mar 24th, 2019
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. /*********************************
  2. * Class: MAGSHIMIM C2 *
  3. * Week: *
  4. * Name: *
  5. * Credits: *
  6. **********************************/
  7.  
  8. #include <stdio.h>
  9. #define SIZE 11
  10.  
  11. void printAfterX(int* arr, int n, int* x);
  12.  
  13. int main(void)
  14. {
  15.  
  16. //Write your code here...
  17. int arr[] = { 4,8,6,2,1,3,5,7,8,9,5 };
  18. int offset = 0;
  19. printf("rwite: ");
  20. scanf("%d", &offset);
  21. int* poff = &offset;
  22. getchar();
  23. printAfterX(arr, SIZE, poff);
  24.  
  25. getchar();
  26. return 0;
  27. }
  28. void printAfterX(int* arr, int n, int* x)
  29. {
  30. if (*x < SIZE)
  31. {
  32. int i = *x;
  33. for (i = i; i < SIZE; i++)
  34. {
  35. printf("%d ", *(arr +i));
  36. }
  37. }
  38. else
  39. {
  40. printf("not in");
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement