- Upvotes Received
- 3
- Posts with Upvotes
- 3
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
4 Posted Topics
Hi I am new to this forum and to c++.I am having problems reading data from a txt file into a 2d array. The data is in the file like this 1 5 87 3 3 24 2 4 62 4 2 22 I am only suppose to read in … | |
[COLOR=#0000ff]#include[/COLOR][COLOR=#000000] <iostream>[/COLOR] [COLOR=#0000ff]#include[/COLOR][COLOR=#000000]<iomanip>[/COLOR] [COLOR=#0000ff]#include[/COLOR][COLOR=#000000] <cmath>[/COLOR] [COLOR=#0000ff]using[/COLOR][COLOR=#0000ff]namespace[/COLOR][COLOR=#000000] std;[/COLOR] [COLOR=#0000ff]int[/COLOR][COLOR=#000000] main()[/COLOR] { [COLOR=#0000ff]char[/COLOR] choice; [COLOR=#0000ff]const[/COLOR] [COLOR=#0000ff]int[/COLOR] arraysize=20; [COLOR=#0000ff]int[/COLOR] num[arraysize]; [COLOR=#0000ff]do [/COLOR]{ cout<<"I will give you the Sum,Mean,Var & the Std Dev of any series of numbers?Y/N:"<<endl; cin>>choice; [COLOR=#0000ff]if[/COLOR](choice =='Y'||choice =='y') { cout<<"How many numbers will you enter? (up to 20)?"; cin>>num[arraysize]; [COLOR=#0000ff]for[/COLOR] … | |
I have #include<iomanip> header also and it's still not working.I am getting 2 dec places but it's .00 Why is that?Please help. here is the code cout << showpoint << fixed << setprecision (2); cout<<"The Mean is "<<mean<<endl; also this code is not working ,when I use the [ ] … ![]() | |
Hi I am new to c++ and I have a simple program that I am trying to understand .Here is the program If anyone can put some comments to what the codes mean I would be grateful.//Explain Please what these lines mean. [code]#include <iostream> using namespace std; int sum(int[],int);// int … |
The End.