Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // array.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include <iostream>
- using namespace std;
- int _tmain(int argc, _TCHAR* argv[])
- {
- int i ;
- const int VAL = 5;//declare 10 elements
- double volt[VAL];//declare voltage as double so it could store in decimal
- cout << "Enter the voltage reading" <<endl;
- for ( i= 0 ; i <= VAL ; i++)
- {
- cout << "Voltage " << i << " : ";
- cin >> volt[i];
- }
- for ( i= 0 ; i <= VAL ; i++)
- {
- cout << " Voltage read for reading no" << i << " is : "<<volt[i] << endl ;
- }
- system ("PAUSE");
- return 0;
- }
Add Comment
Please, Sign In to add comment