im new to this forum and new to C++.
i had a homework problem about arrays. the user inputs a number and i had to store it in an array. up to now i still don't know how to do it. and then after that i had to find max and min and the average of the array. i tried looking for answers in other threads but couldnt find a specific one that deals with this.
moiron 0 Newbie Poster
Recommended Answers
Jump to PostWhat have you tried? Staring at your keyboard with a dumbfounded expression is unproductive, and I suspect that your teacher wouldn't have given you this assignment without providing any prerequisite information.
Here's a start:
#include <iostream> int main() { int num; while ( std::cin>> num ) …
Jump to PostYou've made two posts in this thread with some complaint about "I can't do it, wah wah wah" and offered no code to prove that you've even tried. No offense, but I'm not encouraged to give you any more help at this point. It's beginning to feel like wasted effort …
Jump to Post>>i just wanted to know the basics of what to do in this problem.
RTFM.
To be polite, here is are the steps you must take:1. Construct an Array 2. Ask user how much quantity of data is to be inputed 3. Input all those elements …
Jump to PostCome on, look at the code closer:
for(i=0; i<N; i++) { printf("enter a number"); scanf( "%d", &nwr); newary[i] = nwr; }
If the above code fills the array, how would you start by reading it out? Try to find out what each line does and ask if …
Jump to Posti basically did the for loop again to print the array and it worked hahaXD. thanks guys for helping
Yes! That's exactly what I meant! Good job.
i will check still but im going to try C forums now
I've asked to move this thread to the C-forum
All 19 Replies
Narue 5,707 Bad Cop Team Colleague
moiron 0 Newbie Poster
Narue 5,707 Bad Cop Team Colleague
moiron 0 Newbie Poster
siddhant3s 1,429 Practically a Posting Shark
moiron 0 Newbie Poster
Clockowl 56 Posting Whiz
moiron 0 Newbie Poster
siddhant3s 1,429 Practically a Posting Shark
moiron 0 Newbie Poster
moiron 0 Newbie Poster
Nick Evan 4,005 Industrious Poster Team Colleague Featured Poster
moiron 0 Newbie Poster
Nick Evan 4,005 Industrious Poster Team Colleague Featured Poster
jephthah 1,888 Posting Maven
zaithyn 0 Newbie Poster
jephthah 1,888 Posting Maven
moiron 0 Newbie Poster
jephthah 1,888 Posting Maven
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.