Advertisement
pushrbx

Show array

Mar 23rd, 2013
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <tchar.h>
  3. #include <iostream>
  4.  
  5. const int NUMCARS = 8;
  6.  
  7. int _tmain(int argc, _TCHAR* argv[])
  8. {
  9.     int fuel[NUMCARS]={0,2,0,1,1,2,1,0};
  10.     int carPrice[NUMCARS] = {10000, 8500, 22000, 14000, 37000, 18900, 28000, 45000};
  11.  
  12.     for(int i = 0; i < NUMCARS; i++)
  13.     {
  14.         cout << "Fuel at index " << i << ": " << fuel[i] << endl;
  15.         cout << "carPrice at index " << i << ": "<< carPrice[i] << endl;
  16.     }
  17.  
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement