How to make new integer automatically | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to make new integer automatically

i want to make a lot of integer but dont want spend times to define integer one by one, so i decided using for, but stuck at some point https://code.sololearn.com/cL8SBmBM7P6L/?ref=app

5th Jul 2018, 12:48 PM
Hanif Setyananda
Hanif Setyananda - avatar
3 Answers
+ 3
Use array #include <iostream> using namespace std; int main() { int awo_a[100]; for(int a=0;a<100;a++){ awo_a[a] = a; } return 0; }
5th Jul 2018, 12:54 PM
Calviղ
Calviղ - avatar
+ 2
Try using arrays, you can define an array which can store multiple values of same type. EDIT: //here you can store n number of value, all can access by same name and different index. int array[n];
5th Jul 2018, 12:53 PM
Nikhil Dhama
Nikhil Dhama - avatar
+ 1
i didnt think about that xd, thank you
5th Jul 2018, 12:56 PM
Hanif Setyananda
Hanif Setyananda - avatar