Dear All,
I have written this programme that reads a set of n digits and converts them into a single decimal integer. For example if the input is an array of integers 2,3,4,12,4 then the output should be 234124. My program is hanging when I input a digit. Below is my code, please tell me the error:
Thank you for your reply.Code:#include<stdio.h> int main() { int *a,sum=0,i,n; printf("enter the number of digits"); scanf("%d",&n); for(i=1;i<=n;i++) { scanf("%d",&a[i]); } for(i=1;i<=n;i++) { printf("%d",a[i]); } system("pause"); return 0; }