Is there any way to declare multiple variables in a loop. I mean, if the user gives a number, can the program create so many variables with different names.
No there isn't. If you declare a variable inside a loop then it only exists for the life of the current iteration. What you would do is declare a single variable of the appropriate array type and then use the input when you create the array of the appropriate size.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.