How to assign values in an array using for loop? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to assign values in an array using for loop?

25th Jun 2018, 8:00 PM
Muskan Ghai
Muskan Ghai - avatar
5 Answers
0
In which programming Language do you what to archive this?
25th Jun 2018, 8:02 PM
PartyGuy
PartyGuy - avatar
0
cpp
25th Jun 2018, 8:03 PM
Muskan Ghai
Muskan Ghai - avatar
0
here is how a for loop in c++ works: https://code.sololearn.com/cvO4SHwPIwR8/?ref=app I think you'll get it how to assign values from an array in the for loop!
25th Jun 2018, 8:17 PM
PartyGuy
PartyGuy - avatar
0
I'll do it in C++ #include <iostream> using namespace std; int main() { int arr[9]; for(int i = 0; i<10; i++) { cout << "enter a number"; cin >> arr[i]; } return 0; }
25th Jun 2018, 8:34 PM
Gilbert Keys
Gilbert Keys - avatar
0
thank you.
25th Jun 2018, 8:46 PM
Muskan Ghai
Muskan Ghai - avatar