SHARE
TWEET

Untitled

Cheeel666 Sep 20th, 2019 99 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. int main()
  4. {
  5.     int n;
  6.     double *arr;
  7.     printf("Input number of elements:\n");
  8.     scanf("%d", &n);
  9.     arr = (double*)calloc(n, sizeof(double));
  10.     for (int i = 0; i < n; i++)
  11.     {
  12.         printf("a[%d] = %lf\n",i,arr[i]);
  13.     }
  14.     for (int i = 0; i < n; i++)
  15.     {
  16.         printf("a[%d] = ",i);
  17.         scanf("%lf", &arr[i]);
  18.     }
  19.     for (int i = 0; i < n; i++)
  20.     {
  21.         printf("a[%d] = %lf\n",i, arr[i]);
  22.     }
  23.     return 0;
  24.  
  25. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top