Uploaded by mikolaj.najda00

jezyk c elementy

advertisement
#include <stdio.h>
#include <stdlib.h>
#define size 5
int main()
{
int i, I, POS, VAL;
int array[size];
for(i = 0; i<size; i++)
{
scanf("%d", &array[i]);
}
printf("W ktorej pozycji chcesz wstawic element(Pierwsza pozycja drugi element): \n");
scanf("%d", &POS);
scanf("%d", &VAL);
I = size;
while(I >= POS)
{
array[I + 1] = array[I];
I = I -1;
}
int N = size + 1;
array[POS] = VAL;
printf("\n The array elements are: ");
for(i = 0; i<N; i++)
{
printf("\t %d", array[i]);
}
return 0;
}
Download
Random flashcards
123

2 Cards oauth2_google_0a87d737-559d-4799-9194-d76e8d2e5390

bvbzbx

2 Cards oauth2_google_e1804830-50f6-410f-8885-745c7a100970

66+6+6+

2 Cards basiek49

Create flashcards