Answer Posted / nithin
int main()
{
int i, max;
// Array
int *a;
printf("Enter the size of array\n");
scanf("%d", &max);
//Run time size allocation of an array
a = (int*)malloc(max * sizeof(int));
for(i = 0; i < max;i++)
{
a[i] = i * 2;
printf("value of element %d is %d\n", i, a
[i]);
}
return 0;
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is static and auto variables in c?
what is the role you expect in software industry?
Why C language is a procedural language?
Where register variables are stored in c?
What is typedef example?
What is c mainly used for?
What is time null in c?
How does pointer work in c?
Which is more efficient, a switch statement or an if else chain?
Explain what is the benefit of using enum to declare a constant?
What does calloc stand for?
#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }
Why cant I open a file by its explicit path?
how to count no of words,characters,lines in a paragraph.
Tell us the use of fflush() function in c language?