SHARE
TWEET

Untitled

a guest Oct 21st, 2019 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4.  
  5. int main(){
  6.  
  7.     int num;
  8.     float *temps;
  9.  
  10.     printf("How many temperatures would you like to read? ");
  11.     scanf("%d", &num);
  12.  
  13.     temps = malloc(sizeof(float)*num);
  14.  
  15.     for (int i = 0; i < num; i++){
  16.         printf("Enter a temperature: ");
  17.         scanf("%f", &temps[i]);
  18.     }
  19.  
  20.     for (int j = num-1; j>-1; j--){
  21.         printf("%f, ", temps[j]);
  22.     }
  23.  
  24.  
  25.  
  26.     return 0;
  27. }
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