daily pastebin goal
63%
SHARE
TWEET

Untitled

a guest May 16th, 2018 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int GetTab (int* tab, int size){
  5.     int suma=0;
  6.     for (int i=0;i<size;i++){
  7.         scanf("%d",&suma);
  8.         *(tab+i)=*(tab+i)+suma;
  9.     }
  10.     return 0;
  11. }
  12.  
  13. int main(){
  14.     int *tab;
  15.     int size;
  16.     printf("podaj wielkosc tablicy huju");
  17.     scanf("%d",&size);
  18.     tab=(int*)malloc(sizeof(int)*size);
  19.     GetTab(*tab,size);
  20.     for (int i=0;i<size;i++){
  21.         printf("tab[%d]=%d\n",i,tab[i]);
  22.     }
  23.  
  24.  
  25.     return 0;
  26. }
RAW Paste Data
Top