C
coinjo
I need to write a program, which takes any number of digits, and
combine them in the form of one integer value.
User will enter the digits one by one. The number of the digits to be
entered by the user is not known. The initial structure of the program
is written below. User enters -1 as an end marker.
int Digit=0;
int Var1=0;
cout<<"Enter a digit. Enter -1 to stop"<<endl;
while (Digit!=-1)
{
cin>>Digit;
/Write syntax here to combine the digits to form an
integer/
}
cout<<"The value is"<<endl;
cout<<Var1;
combine them in the form of one integer value.
User will enter the digits one by one. The number of the digits to be
entered by the user is not known. The initial structure of the program
is written below. User enters -1 as an end marker.
int Digit=0;
int Var1=0;
cout<<"Enter a digit. Enter -1 to stop"<<endl;
while (Digit!=-1)
{
cin>>Digit;
/Write syntax here to combine the digits to form an
integer/
}
cout<<"The value is"<<endl;
cout<<Var1;