How to enter any data from user in same line in an array | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 6

How to enter any data from user in same line in an array

Like i want to enter any number and that must be like 1234667 in same line

13th Aug 2019, 2:32 AM
Mohammad Aarif Ansari
Mohammad Aarif Ansari - avatar
7 Answers
+ 2
Use std::cin
13th Aug 2019, 2:42 AM
Sonic
Sonic - avatar
+ 1
use code cin for example: #include <iostream> using namespace std; int main() { int a; cout << "Please enter a number \n"; cin >> a; return 0; }
14th Aug 2019, 6:19 AM
Prakash
0
Mohammad Aarif Ansari Try to ask the question in a way that makes sense.
15th Aug 2019, 6:29 AM
Vishnu
Vishnu - avatar
0
cin >> a >> b >>...;
17th Aug 2019, 1:27 PM
BinaryEden
BinaryEden - avatar
0
Are you asking for a multidimensional array?If yes then If the first row is completely filled then it goes for the next as per iteration .But if you want store more data in a single row it must be large enough .example: Arr[50][10]
3rd Sep 2019, 2:45 PM
Araib Khan
Araib Khan - avatar
0
I think maybe you are asking for insertion in middle which is not possible in an array
3rd Sep 2019, 2:45 PM
Araib Khan
Araib Khan - avatar
- 1
In this code new line will automatically created
15th Aug 2019, 6:27 AM
Mohammad Aarif Ansari
Mohammad Aarif Ansari - avatar