Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- int n;
- printf("podaj rozmiar tablicy");
- scanf("%d",&n);
- int *tab_int;
- tab_int=(int*)malloc(n*sizeof(int));
- int i;
- for (i=0;i<n;i++)
- {
- printf("podaj element nr %d z %d do tablicy \n",i+1,n);
- scanf("%d",&tab_int[i]);
- }
- printf("podaj rozmiar tablicy");
- scanf("%d",&n);
- tab_int=(int*) realloc(tab_int,n*sizeof(int));
- if (tab_int==NULL) printf("blad");else
- for (i=0;i<n;i++)
- {
- printf("podaj element nr %d z %d do tablicy \n",i+1,n);
- scanf("%d",&tab_int[i]);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement