Help need for a C program! SOS
Filed Under mercialleasing.com |
Write a Program to accept 10 numbers using one dimensional array and display them.
here how i tried, but haven't executed.
int a[10],i,n;
printf(Enter the number of elements");
scanf("%d", &n);
printf("Enter the elements");
for (i=0;i
and the print statement
All the statements can work.
Only problem can arise is that if I enter number of elements as >10, then it will overwrite to some other memory area.
and ya when value is n is less than 10 then it will work surely but if input value of n greater than 10 then it will produce errors as that will be on garbage addresses
+++ RESOLVED +++
#If you have any other info about this subject , Please add it free.# |