i have to convert an array of integers into number. for the given code if a test case is taken as 1 0 7 6 2 for an array of 5 numbers output is 10761

int main()
int t,n,k,i;
int sum;
int a[n];
return 0;

Just don’t use the pow function if your result will not be a floating type. In this case is recommended to write your own function (or in this case to use another variable, let’s say power, which is multiplied by 10 every loop).

Hello destiny_me ,

You can achieve using this way …

 int num = 0 ;
 for(int i=0;i<n;i++){
      num = num * 10 + arr[i] ;
 cout << num << endl ;

Here is the recursive way for the same:

int find_num(int a[], int start, int n, int num)
 return num;
num= num*10 + a[start];
return find_num(a,start+1,n,num);

with the call : cout<<find_num(a,0,n,0); // a is the input array and n is total number in the array and start refers to the starting index i.e. 0 and num, is the number formed at some particular step.

you can just use StringBuilder or StringBuffer and append every number of array and last you can convert string into number by parsing it…