Guest User

Untitled

a guest
Oct 21st, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. // array.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include <iostream>
  6.  
  7. using namespace std;
  8.  
  9. int _tmain(int argc, _TCHAR* argv[])
  10. {
  11. int i ;
  12.  
  13. const int VAL = 5;//declare 10 elements
  14. double volt[VAL];//declare voltage as double so it could store in decimal
  15.  
  16. cout << "Enter the voltage reading" <<endl;
  17.  
  18. for ( i= 0 ; i <= VAL ; i++)
  19. {
  20. cout << "Voltage " << i << " : ";
  21. cin >> volt[i];
  22. }
  23.  
  24. for ( i= 0 ; i <= VAL ; i++)
  25. {
  26. cout << " Voltage read for reading no" << i << " is : "<<volt[i] << endl ;
  27. }
  28. system ("PAUSE");
  29. return 0;
  30. }
Add Comment
Please, Sign In to add comment