Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<stdlib.h>
- void last(int arr[],int n, int p){
- for(int i = 0; i < 23; i++){
- if(arr[i]<p){
- n=i;
- }
- }
- arr[n] = n;
- for(int i = 0; i < 23; i++){
- printf("arr[%d] = %d\n",i, arr[i] );
- }
- printf("\nposl el index = %d", n);
- }
- int main()
- {
- /*void last(int arr[], int n, int p, int *idx)*/
- int p, mas[23], n=0;
- printf("p=");
- scanf("%d", &p);
- for(int i = 0; i < 23; i++){
- printf("mas %d= ", i);
- scanf("%d", &mas[i]);
- }
- last(mas,n,p);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement