You need to be using array instead of a value type variable,
int cnic,a=0;
That will be changed to,
int cnic[13];
int a = 0;
This will be a container, that can contain 13 values. And also, you might want to take a look at
do...while
, instead of
while
loops as I believe that is what you are looking for, as your code won't work as you are expecting it to work. And moreover, '\0' is what you are looking for, not '/0'. :laugh:
A simple tip would be, consider using a
for(;;)
loop instead of this
while
loop.
So much to learn brother, please follow the following links and explore a bit more of C++,
Arrays - C++ Tutorials[
^]
loops - The difference between while and do while C++? - Stack Overflow[
^]
c# - 'do...while' vs. 'while' - Stack Overflow[
^]